// Find out a better way of doing this, Since ORBD is an important
// process which should not be killed because of some external process
// orb.setPersistentServerId( (int) 1000 );
// get and activate the root naming POA
POA rootPOA = (POA)orb.resolve_initial_references(
ORBConstants.ROOT_POA_NAME ) ;
rootPOA.the_POAManager().activate();
// create a new POA for persistent Naming Contexts
// With Non-Retain policy, So that every time Servant Manager
// will be contacted when the reference is made for the context
// The id assignment is made by the NameServer, The Naming Context
// id's will be in the format NC<Index>
int i=0;
Policy[] poaPolicy = new Policy[4];
poaPolicy[i++] = rootPOA.create_lifespan_policy(
LifespanPolicyValue.PERSISTENT);
poaPolicy[i++] = rootPOA.create_request_processing_policy(
RequestProcessingPolicyValue.USE_SERVANT_MANAGER);
poaPolicy[i++] = rootPOA.create_id_assignment_policy(
IdAssignmentPolicyValue.USER_ID);
poaPolicy[i++] = rootPOA.create_servant_retention_policy(
ServantRetentionPolicyValue.NON_RETAIN);
nsPOA = rootPOA.create_POA("NameService", null, poaPolicy);
nsPOA.the_POAManager().activate( );
// create and set the servant manager
contextMgr = new
ServantManagerImpl(orb, logDir, this );