protected String startLookup(int indx, int port, String serviceHost) throws Exception {
logger.log(Level.FINE, " starting lookup service "+indx);
/* retrieve the member groups with which to configure the lookup */
String[] memberGroups = (String[])memberGroupsList.get(indx);
ServiceRegistrar lookupProxy = null;
String simulatorName =
"com.sun.jini.test.services.lookupsimulator.LookupSimulatorImpl";
if(implClassname.equals(simulatorName)) {
DiscoveryProtocolSimulator generator = null;
if(debugsync) logger.log(Level.FINE,
" BaseQATest.startLookup - "
+"sync on lookupList --> requested");
synchronized(lookupList) {
if(debugsync) logger.log(Level.FINE,
" BaseQATest.startLookup - "
+"sync on lookupList --> granted");
/* Use either a random or an explicit locator port */
generator = new DiscoveryProtocolSimulator
(config,memberGroups,manager, port);
genMap.put( generator, memberGroups );
lookupProxy = generator.getLookupProxy();
lookupList.add( lookupProxy );
if(debugsync) logger.log(Level.FINE,
" BaseQATest.startLookup - "
+" added new proxy to lookupList");
if(debugsync) logger.log(Level.FINE,
" BaseQATest.startLookup - "
+"sync on lookupList --> released");
}//end sync(lookupList)
/* Force non-unique groups for manual tests */
if( (testType == MANUAL_TEST_REMOTE_COMPONENT)
|| (testType == MANUAL_TEST_LOCAL_COMPONENT) )
{
generator.setMemberGroups(memberGroups);
}//endif
} else {//start a non-simulated lookup service implementation
if(debugsync) logger.log(Level.FINE,
" BaseQATest.startLookup - "
+"sync on lookupList --> requested");
synchronized(lookupList) {
if(debugsync) logger.log(Level.FINE,
" BaseQATest.startLookup - "
+"sync on lookupList --> granted");
/* returned proxy is already prepared */
lookupProxy = manager.startLookupService(serviceHost);
lookupList.add( lookupProxy );
if(debugsync) logger.log(Level.FINE,
" BaseQATest.startLookup - "
+" added new proxy to lookupList");
if(debugsync) logger.log(Level.FINE,
" BaseQATest.startLookup - "
+"sync on lookupList --> released");
}//end sync(lookupList)
genMap.put( lookupProxy, memberGroups );
/* Force non-unique groups for manual tests */
if( (testType == MANUAL_TEST_REMOTE_COMPONENT)
|| (testType == MANUAL_TEST_LOCAL_COMPONENT) )
{
if(lookupProxy instanceof Administrable) {
Object admin = ((Administrable)lookupProxy).getAdmin();
admin = getConfig().prepare("test.reggieAdminPreparer",
admin);
if(admin instanceof DiscoveryAdmin) {
((DiscoveryAdmin)admin).setMemberGroups(memberGroups);
}
}
}
}
LookupLocator lookupLocator =
QAConfig.getConstrainedLocator(lookupProxy.getLocator());
LocatorGroupsPair locGroupsPair = new LocatorGroupsPair(lookupLocator,
memberGroups);
try {
lookupsStarted.add(indx,locGroupsPair);
} catch(IndexOutOfBoundsException e) {