@Override
public void start(StartContext context) throws StartException {
log.debugf("Starting Service " + context.getController().getName().getCanonicalName());
ORB orb = orbInjector.getValue();
POA rootPOA = rootPOAInjector.getValue();
POA namingPOA = namingPOAInjector.getValue();
try {
// initialize the static naming service variables.
JBossNamingContext.init(orb, rootPOA);
// create and initialize the root context instance according to the configuration.
JBossNamingContext ns = new JBossNamingContext();
Configuration configuration = ((org.jacorb.orb.ORB) orb).getConfiguration();
boolean doPurge = configuration.getAttribute("jacorb.naming.purge", "off").equals("on");
boolean noPing = configuration.getAttribute("jacorb.naming.noping", "off").equals("on");
ns.init(namingPOA, doPurge, noPing);
// create and activate the root context.
byte[] rootContextId = "root".getBytes();
namingPOA.activate_object_with_id(rootContextId, ns);
namingService = NamingContextExtHelper.narrow(namingPOA.create_reference_with_id(rootContextId,
"IDL:omg.org/CosNaming/NamingContextExt:1.0"));
} catch (Exception e) {
throw new StartException("Failed to start the CORBA Naming Service", e);
}
// bind the corba naming service to JNDI.
CorbaServiceUtil.bindObject(context.getChildTarget(), "corbanaming", namingService);
log.info("CORBA Naming Service Started");
log.debugf("Naming: [" + orb.object_to_string(namingService) + "]");
}