policies.add(ZeroPortPolicy.getPolicy()); if (this.idAssignmentPolicyValue != null) policies.add(poa.create_id_assignment_policy(this.idAssignmentPolicyValue)); if (this.idUniquenessPolicyValue != null) policies.add(poa.create_id_uniqueness_policy(this.idUniquenessPolicyValue));
public synchronized void start(final StartContext startContext) throws StartException { transientPoaMap = Collections.synchronizedMap(new HashMap<String, POA>()); persistentPoaMap = Collections.synchronizedMap(new HashMap<String, POA>()); final POA rootPOA = this.rootPOA.getValue(); // Policies for per-servant transient POAs transientPoaPolicies = new Policy[]{rootPOA.create_lifespan_policy( LifespanPolicyValue.TRANSIENT), rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.SYSTEM_ID), rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.NON_RETAIN), rootPOA.create_request_processing_policy(RequestProcessingPolicyValue.USE_DEFAULT_SERVANT), rootPOA.create_id_uniqueness_policy( IdUniquenessPolicyValue.MULTIPLE_ID), }; // Policies for per-servant persistent POAs persistentPoaPolicies = new Policy[]{ rootPOA.create_lifespan_policy( LifespanPolicyValue.PERSISTENT), rootPOA.create_id_assignment_policy( IdAssignmentPolicyValue.USER_ID), rootPOA.create_servant_retention_policy( ServantRetentionPolicyValue.NON_RETAIN), rootPOA.create_request_processing_policy( RequestProcessingPolicyValue.USE_DEFAULT_SERVANT), rootPOA.create_id_uniqueness_policy( IdUniquenessPolicyValue.MULTIPLE_ID), }; // Create this POARegistry's ServantRegistry implementations registryWithTransientPOAPerServant = new ServantRegistryWithTransientPOAPerServant(); registryWithPersistentPOAPerServant = new ServantRegistryWithPersistentPOAPerServant(); }
policies.add(ZeroPortPolicy.getPolicy()); if (this.idAssignmentPolicyValue != null) policies.add(poa.create_id_assignment_policy(this.idAssignmentPolicyValue)); if (this.idUniquenessPolicyValue != null) policies.add(poa.create_id_uniqueness_policy(this.idUniquenessPolicyValue));
policies.add(ZeroPortPolicy.getPolicy()); if (this.idAssignmentPolicyValue != null) policies.add(poa.create_id_assignment_policy(this.idAssignmentPolicyValue)); if (this.idUniquenessPolicyValue != null) policies.add(poa.create_id_uniqueness_policy(this.idUniquenessPolicyValue));
/** * Build a new POA (with csiv2 policy) * @param nameId name for POA * @return a POA * @throws Exception if the POA cannot be created */ private POA createSecurePOA(final String nameId) throws Exception { //TODO : Detect if a POA with this name already exists and avoid to // create it. // use random for now // Create policies org.omg.CORBA.Policy[] policies = new org.omg.CORBA.Policy[POA_POLICIES_NUMBER]; policies[0] = rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID); policies[1] = rootPOA.create_lifespan_policy(LifespanPolicyValue.TRANSIENT); policies[2] = new SasPolicy(sasComponent); return rootPOA.create_POA(nameId + Math.random(), rootPOA.the_POAManager(), policies); }
protected POA createPOA(String name, POA parentPOA, POAManager poaManager) { List<Policy> policies = new ArrayList<>(); policies.add(parentPOA .create_thread_policy(ThreadPolicyValue.ORB_CTRL_MODEL)); if (isPersistent) { policies.add(parentPOA .create_lifespan_policy(LifespanPolicyValue.PERSISTENT)); } else { policies.add(parentPOA .create_lifespan_policy(LifespanPolicyValue.TRANSIENT)); } if (serviceId != null) { policies.add(parentPOA .create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID)); } policies.add(parentPOA.create_id_uniqueness_policy(IdUniquenessPolicyValue.MULTIPLE_ID)); RequestProcessingPolicyValue value = RequestProcessingPolicyValue.USE_DEFAULT_SERVANT; policies.add(parentPOA.create_request_processing_policy(value)); orbConfig.addPOAPolicies(orb, name, parentPOA, poaManager, policies); Policy[] policyList = policies.toArray(new Policy[0]); try { return parentPOA.create_POA(name, poaManager, policyList); } catch (Exception ex) { throw new CorbaBindingException( "Could not create POA during activation", ex); } } public EndpointReferenceType getAddressWithId(String id) {
public synchronized void start(final StartContext startContext) throws StartException { transientPoaMap = Collections.synchronizedMap(new HashMap<String, POA>()); persistentPoaMap = Collections.synchronizedMap(new HashMap<String, POA>()); final POA rootPOA = this.rootPOA.getValue(); // Policies for per-servant transient POAs transientPoaPolicies = new Policy[]{rootPOA.create_lifespan_policy( LifespanPolicyValue.TRANSIENT), rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID), rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.NON_RETAIN), rootPOA.create_request_processing_policy(RequestProcessingPolicyValue.USE_DEFAULT_SERVANT), rootPOA.create_id_uniqueness_policy( IdUniquenessPolicyValue.MULTIPLE_ID), }; // Policies for per-servant persistent POAs persistentPoaPolicies = new Policy[]{ rootPOA.create_lifespan_policy( LifespanPolicyValue.PERSISTENT), rootPOA.create_id_assignment_policy( IdAssignmentPolicyValue.USER_ID), rootPOA.create_servant_retention_policy( ServantRetentionPolicyValue.NON_RETAIN), rootPOA.create_request_processing_policy( RequestProcessingPolicyValue.USE_DEFAULT_SERVANT), rootPOA.create_id_uniqueness_policy( IdUniquenessPolicyValue.MULTIPLE_ID), }; // Create this POARegistry's ServantRegistry implementations registryWithTransientPOAPerServant = new ServantRegistryWithTransientPOAPerServant(); registryWithPersistentPOAPerServant = new ServantRegistryWithPersistentPOAPerServant(); }
poa.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID)};
root_poa.create_lifespan_policy(LifespanPolicyValue.PERSISTENT); policies[1] = root_poa.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID);
policy[1] = rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.SYSTEM_ID); policy[2] = rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.RETAIN);
rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID); policies[1] = rootPOA.create_lifespan_policy(LifespanPolicyValue.PERSISTENT);
_ps.add(_rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID));
rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID), rootPOA.create_id_uniqueness_policy(IdUniquenessPolicyValue.MULTIPLE_ID), rootPOA.create_request_processing_policy(RequestProcessingPolicyValue.USE_DEFAULT_SERVANT)
rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID), rootPOA.create_id_uniqueness_policy(IdUniquenessPolicyValue.MULTIPLE_ID), rootPOA.create_request_processing_policy(RequestProcessingPolicyValue.USE_DEFAULT_SERVANT)
private synchronized void createbiPOA( ) { if( biPOA != null ) { return; } try { POA rootPOA = (POA) orb.resolve_initial_references( ORBConstants.ROOT_POA_NAME ); rootPOA.the_POAManager().activate( ); int i = 0; Policy[] poaPolicy = new Policy[3]; poaPolicy[i++] = rootPOA.create_lifespan_policy( LifespanPolicyValue.TRANSIENT); poaPolicy[i++] = rootPOA.create_id_assignment_policy( IdAssignmentPolicyValue.SYSTEM_ID); poaPolicy[i++] = rootPOA.create_servant_retention_policy( ServantRetentionPolicyValue.RETAIN); biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy ); biPOA.the_POAManager().activate( ); } catch( Exception e ) { throw readWrapper.namingCtxBindingIteratorCreate( e ) ; } }
rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID), rootPOA.create_id_uniqueness_policy(IdUniquenessPolicyValue.MULTIPLE_ID), rootPOA.create_request_processing_policy(RequestProcessingPolicyValue.USE_DEFAULT_SERVANT)
policy[1] = rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.SYSTEM_ID); policy[2] = rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.RETAIN);
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(
poaPolicy[i++] = rootPOA.create_lifespan_policy( LifespanPolicyValue.TRANSIENT); poaPolicy[i++] = rootPOA.create_id_assignment_policy( IdAssignmentPolicyValue.SYSTEM_ID); poaPolicy[i++] = rootPOA.create_servant_retention_policy(