*/
protected void addGroupsOneReg(String[] groups,
Map.Entry regListenerPair)
throws RemoteException
{
LookupDiscoveryRegistration reg
= (LookupDiscoveryRegistration)regListenerPair.getKey();
RegistrationInfo regInfo
= ((LDSEventListener)regListenerPair.getValue()).getRegInfo();
String[] groupsToDiscover = groups;
if( (regInfo.groupsToDiscover != DiscoveryGroupManagement.ALL_GROUPS)
&&(groups != DiscoveryGroupManagement.ALL_GROUPS) )
{
int curLen = (regInfo.groupsToDiscover).length;
int newLen = groups.length;
groupsToDiscover = new String[curLen + newLen];
for(int i=0;i<curLen;i++) {
groupsToDiscover[i] = new String(regInfo.groupsToDiscover[i]);
}//end loop
for(int i=curLen;i<(curLen+newLen);i++) {
groupsToDiscover[i] = new String(groups[i-curLen]);
}//end loop
synchronized(regInfo) {
/* update the expected state for this regInfo information */
regInfo.setLookupsToDiscover(groupsToDiscover,
new LookupLocator[0]);
}//end sync(regInfo)
}//endif
/* Add to the groups the lds should discover for this registration */
reg.addGroups(groups);
}//end addGroupsOneReg