public void start() throws Exception
{
Context ctx;
ORB orb;
POA rootPOA;
try {
ctx = new InitialContext();
}
catch (NamingException e) {
throw new RuntimeException("Cannot get intial JNDI context: " + e);
}
try {
orb = (ORB)ctx.lookup("java:/" + CorbaORBService.ORB_NAME);
}
catch (NamingException e) {
throw new RuntimeException("Cannot lookup java:/"
+ CorbaORBService.ORB_NAME + ": " + e);
}
try {
rootPOA = (POA)ctx.lookup("java:/" + CorbaORBService.POA_NAME);
}
catch (NamingException e) {
throw new RuntimeException("Cannot lookup java:/"
+ CorbaORBService.POA_NAME + ": " + e);
}
// Create the naming server POA as a child of the root POA
Policy[] policies = new Policy[2];
policies[0] =
rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID);
policies[1] =
rootPOA.create_lifespan_policy(LifespanPolicyValue.PERSISTENT);
namingPOA = rootPOA.create_POA("Naming", null, policies);
namingPOA.the_POAManager().activate();
// Create the naming service
org.jacorb.naming.NamingContextImpl.init(orb, rootPOA);
NamingContextImpl ns = new NamingContextImpl(namingPOA);