public void startRMIServer(NullActivityFactoryImpl naf,
SleeInternalEndpoint endpoint, EventLookup eventLookup,
ActivityContextFactoryImpl activityContextFactory) {
RemoteSleeService stub = null;
try {
if (logger.isDebugEnabled()) {
logger.debug("Starting Slee Service HARMI Server");
}
InitialContext ctx = new InitialContext();
HAPartition myPartition = (HAPartition) ctx
.lookup("/HAPartition/DefaultPartition");
rmiServer = new HARMIServerImpl(myPartition, "RemoteSleeService",
RemoteSleeService.class, new RemoteSleeServiceImpl(naf,
eventLookup, activityContextFactory));
stub = (RemoteSleeService) rmiServer
.createHAStub(new FirstAvailable());
ctx.rebind("/SleeService", stub);
if (logger.isDebugEnabled()) {
logger.debug("Bound SleeService rmi stub in jndi");
}
} catch (Exception e) {
logger.error("Failed to start HA RMI server for Remote slee service",
e);
}
}