Refine search
this.poa = POAHelper.narrow(orb.resolve_initial_references(this.poaName)); } catch (Exception e) { throw IIOPLogger.ROOT_LOGGER.errorResolvingInitRef(this.poaName, e); try { Policy[] poaPolicies = this.createPolicies(parentPOA); this.poa = parentPOA.create_POA(this.poaName, null, poaPolicies); } catch (Exception e) { throw IIOPLogger.ROOT_LOGGER.errorCreatingPOAFromParent(e); this.poa.the_POAManager().activate(); } catch (Exception e) { throw IIOPLogger.ROOT_LOGGER.errorActivatingPOA(e);
public void destroy() { bindings = null; try { _poa().deactivate_object(_poa().servant_to_id(this)); } catch (UserException e) { throw IIOPLogger.ROOT_LOGGER.exceptionDestroingIterator(e.getMessage()); } }
namingPOA.activate_object_with_id(rootContextId, ns); namingService = NamingContextExtHelper.narrow(namingPOA.create_reference_with_id(rootContextId, "IDL:omg.org/CosNaming/NamingContextExt:1.0")); namingPOA.servant_to_reference(ns)); final String rootContext = properties.getProperty(Constants.NAMING_ROOT_CONTEXT); ((com.sun.corba.se.impl.orb.ORBImpl) orb).register_initial_reference(rootContext, namingPOA.servant_to_reference(ns)); IIOPLogger.ROOT_LOGGER.debugf("Naming: [%s]", orb.object_to_string(namingService));
public void unbind(final String name) throws Exception { final POA poa = transientPoaMap.remove(name); if (poa != null) { poa.the_POAManager().deactivate(false, true); poa.destroy(false, true); } }
public ReferenceFactory bind(final String name, final Servant servant) throws Exception { final POA poa = rootPOA.getValue().create_POA(name, null, transientPoaPolicies); transientPoaMap.put(name, poa); poa.set_servant(servant); poa.the_POAManager().activate(); return new PoaReferenceFactory(poa); // no servantName: in this case // name is the POA name }
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(); }
public void createPOA (String adapterName, Policy[] policies) throws AdapterAlreadyExists, InvalidPolicy, AdapterInactive, SystemException { if (_poa == null) { opLogger.i18NLogger.warn_internal_orbspecific_oa_implementations("jacorb_2_0.createPOA"); throw new AdapterInactive(); } POA childPoa = _poa.create_POA(adapterName, _poa.the_POAManager(), policies); childPoa.the_POAManager().activate(); super._poas.put(adapterName, childPoa); }
synchronized LockCoordinator get_lock_coordinator( TransactionalLockSetImpl ls ){ LockCoordinatorImpl lc = (LockCoordinatorImpl)locksets.get( ls ); if( lc == null ){ lc = new LockCoordinatorImpl( this, ls ); locksets.put( ls, lc ); } try { return LockCoordinatorHelper.narrow(poa.servant_to_reference(lc)); } catch ( Exception e ){ e.printStackTrace( System.out ); throw new org.omg.CORBA.INTERNAL(); } };
synchronized void remove_coordinator( TransactionalLockSetImpl ls ){ LockCoordinatorImpl lc = (LockCoordinatorImpl)locksets.get( ls ); if( lc != null ){ try { byte [] ObjId = poa.servant_to_id( lc ); poa.deactivate_object( ObjId ); } catch ( Exception e ) { } locksets.remove( ls ); } }; public void run() {
public org.omg.CORBA.Object get_reference() throws org.omg.PortableServer.CurrentPackage.NoContext { CurrentState state = (CurrentState) stateKey_.get(Thread .currentThread()); if (state == null || state.poa == null) throw new org.omg.PortableServer.CurrentPackage.NoContext(); try { return state.poa.servant_to_reference(state.servant); } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.PortableServer.POAPackage.ServantNotActive ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } return null; }
synchronized void remove_me( TransactionCoordinator i_am ){ coordinators.remove( i_am.get_coordinator() ); try { byte [] ObjId = poa.servant_to_id( i_am ); poa.deactivate_object( ObjId ); } catch ( Exception e ){ e.printStackTrace( System.out ); throw new org.omg.CORBA.INTERNAL(); } } /* -------------------------------------------------------------------------- */
synchronized void remove_me( TransactionalLockSetImpl i_am ){ Enumeration enumeration = coordinators.elements(); while( enumeration.hasMoreElements() ){ TransactionCoordinator tc = (TransactionCoordinator)enumeration.nextElement(); tc.remove_coordinator( i_am ); } try { byte [] ObjId = poa.servant_to_id( i_am ); poa.deactivate_object( ObjId ); } catch ( Exception e ){ e.printStackTrace( System.out ); throw new org.omg.CORBA.INTERNAL(); } }; };
public static void main( String[] args ) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null); try { org.omg.PortableServer.POA poa = org.omg.PortableServer.POAHelper.narrow( orb.resolve_initial_references("RootPOA")); poa.the_POAManager().activate(); org.omg.CORBA.Object o = poa.servant_to_reference(new TracingServiceImpl()); NamingContextExt nc = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService")); nc.bind( nc.to_name("tracing.service"), o); poa.the_POAManager().activate(); } catch ( Exception e ) { e.printStackTrace(); } orb.run(); } }
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 ) ; } }
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)); if (this.implicitActivationPolicyValue != null) policies.add(poa.create_implicit_activation_policy(this.implicitActivationPolicyValue)); if (this.lifespanPolicyValue != null) policies.add(poa.create_lifespan_policy(this.lifespanPolicyValue)); if (this.requestProcessingPolicyValue != null) policies.add(poa.create_request_processing_policy(this.requestProcessingPolicyValue)); if (this.servantRetentionPolicyValue != null) policies.add(poa.create_servant_retention_policy(this.servantRetentionPolicyValue)); if (this.threadPolicyValue != null) policies.add(poa.create_thread_policy(this.threadPolicyValue));
/** * EventChannel constructor. */ public EventChannelImpl(org.omg.CORBA.ORB orb, org.omg.PortableServer.POA poa) { myOrb = orb; myPoa = poa; _this_object(myOrb); nullAny = myOrb.create_any(); nullAny.type(myOrb.get_primitive_tc( TCKind.tk_null)); try { this.myPoa = poa; myPoa.the_POAManager().activate(); } catch( Exception e ) { e.printStackTrace(); } }
public SequenceFactoryImpl (org.omg.PortableServer.POA poa) { this.poa = poa; try { poa.servant_to_reference (this); } catch (Exception e) { System.out.println ("Internal error: Can not activate factory"); e.printStackTrace (); throw new org.omg.CORBA.INTERNAL (); } }
/** * Create a new context of the same type as the * calling context. * * @return A new NamingContext item. * @exception org.omg.CosNaming.NamingContextPackage.NotFound * @exception SystemException */ public NamingContext new_context() throws SystemException { try { // create a new context. Then we need to register this with the POA and activate it. TransientNamingContext newContext = new TransientNamingContext(orb, poa, rootContext); byte[] objectId = poa.activate_object(newContext); org.omg.CORBA.Object obj = poa.id_to_reference(objectId); return NamingContextHelper.narrow(obj); } catch (SystemException e) { // just propagate system exceptions throw e; } catch (Exception e) { throw (INTERNAL)(new INTERNAL("Unable to create new naming context").initCause(e)); } }
public NamingContext new_context() { try { // create and initialize a new context. CorbaNamingContext newContextImpl = new CorbaNamingContext(); newContextImpl.init(this.poa, this.doPurge, this.noPing); // create the oid for the new context and activate it with the naming service POA. String oid = new String(this.poa.servant_to_id(this), StandardCharsets.UTF_8) + "/ctx" + (++this.childCount); this.poa.activate_object_with_id(oid.getBytes(StandardCharsets.UTF_8), newContextImpl); // add the newly-created context to the cache. contextImpls.put(oid, newContextImpl); return NamingContextExtHelper.narrow(this.poa.create_reference_with_id(oid.getBytes(StandardCharsets.UTF_8), "IDL:omg.org/CosNaming/NamingContextExt:1.0")); } catch (Exception e) { IIOPLogger.ROOT_LOGGER.failedToCreateNamingContext(e); return null; } }
EventManager.getManager().disconnected(obj); _oa.rootPoa().deactivate_object(_oa.rootPoa().reference_to_id(obj)); else invalidPOA = true;