e.printStackTrace();
throw new RuntimeException(e.toString());
}
logger.log(Level.FINE, "registering test service "
+i+" with lookup service "+loc);
ServiceRegistration srvcReg =
lookupProxy.register(new ServiceItem(srvcID,testService,null),
Long.MAX_VALUE);
Lease srvcLease = null;
try {
srvcReg = (ServiceRegistration) getConfig().prepare(
"test.reggieServiceRegistrationPreparer",
srvcReg);
srvcLease = (Lease) getConfig().prepare(
"test.reggieServiceRegistrationPreparer",
srvcReg.getLease());
} catch (TestException e) {
throw new RemoteException("Configuration error", e);
}
regInfo.srvcID = srvcID;
regInfo.srvcReg = srvcReg;
regInfo.srvcLease = srvcLease;
regInfo.lookupProxy = lookupProxy;
/* Renew the service's lease until the test is complete */
leaseRenewalMgr.renewUntil(srvcLease,
Lease.FOREVER, //expiration
leaseListener);//listener
if(reRegister) {
/* Remove old lease from local leaseList and from LRM */
leaseRenewalMgr.remove( (Lease)(leaseList.remove(0)) );
}//endif
/* Store the new lease for clean up at the end of the test */
leaseList.add(srvcLease); //add the new lease
/* Create and set attribute(s) for service just registered */
if(nAttrs > 0) {
regInfo.srvcAttrs = new Entry[nAttrs];
Entry[] attrs = new Entry[nAttrs];
for(int k=0;k<nAttrs;k++) {
logger.log(Level.FINE, "registering attribute "+k
+" with test service "+i);
if(k==0) {
attrs[k] = new TestServiceIntAttr(attrVal);
} else { // placeholder for future attributes
attrs[k] = new TestServiceIntAttr(attrVal);
}//endif
regInfo.srvcAttrs[k] = attrs[k];
}//end loop
srvcReg.setAttributes(attrs);
}//endif
regInfoList.add(regInfo);
}//end loop (j) - service registration loop
synchronized(regInfoMap) {
if(reRegister) {