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 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); } }
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init( args, argProps ); _imr.configure(((org.jacorb.orb.ORB) orb).getConfiguration()); POA root_poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); root_poa.the_POAManager().activate(); root_poa.create_lifespan_policy(LifespanPolicyValue.PERSISTENT); policies[1] = root_poa.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID); POA imr_poa = root_poa.create_POA( "ImRPOA", final org.omg.CORBA.Object imrReference = imr_poa.servant_to_reference(_imr); _out.println(orb.object_to_string(imrReference)); _out.flush(); _out.close();
orb = org.omg.CORBA.ORB.init(args, props); org.omg.PortableServer.POAHelper.narrow(orb.resolve_initial_references("RootPOA")); rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID); policies[1] = rootPOA.create_lifespan_policy(LifespanPolicyValue.PERSISTENT); rootPOA.create_request_processing_policy( RequestProcessingPolicyValue.USE_SERVANT_MANAGER); nsPOA.set_servant_manager( servantActivator ); nsPOA.the_POAManager().activate(); new PrintWriter( new FileOutputStream( fileName ), true ); out.println( orb.object_to_string(obj) ); out.close();
public static void main( String[] args ) org.omg.CORBA.ORB.init(args, null); logger = ((org.jacorb.orb.ORB)orb).getConfiguration().getLogger("org.jacorb.tx_service"); org.omg.PortableServer.POAHelper.narrow(orb.resolve_initial_references("RootPOA")); poa.the_POAManager().activate(); ps.println( orb.object_to_string( transactionService.get_reference() ) ); ps.close();
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 ) ; } }
POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); POAManager poaManager = rootPOA.the_POAManager(); try { bindingPOA = rootPOA.find_POA(poaName, false); } catch (org.omg.PortableServer.POAPackage.AdapterNonExistent ex) { objectId = serviceId.getBytes(); try { bindingPOA.activate_object_with_id(objectId, servant); } catch (org.omg.PortableServer.POAPackage.ObjectAlreadyActive ex) { if (!isPersistent) { orbConfig.exportObjectReference(orb, obj, location, address); populateEpr(orb.object_to_string(obj)); LOG.info("Object Reference: " + orb.object_to_string(obj)); poaManager.activate(); } catch (Exception ex) { throw new CorbaBindingException("Unable to activate CORBA servant", ex);
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 }
RegistrationHelper.narrow( orb.resolve_initial_references("ImplementationRepository")); if( _registration == null ) throw new ConfigurationException("ImR not found"); POA poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); poa.the_POAManager().activate(); ServerStartupDaemonHelper.narrow(poa.servant_to_reference(this)); orb.object_to_string(ssd));
ourPOA.set_servant(theButler); org.omg.CORBA.Object obj = ourPOA.create_reference_with_id(RC_ID.getBytes(), RecoveryCoordinatorHelper.id()); String reference = _orb.orb().object_to_string(obj); _oa.rootPoa().the_POAManager().activate();
throws Exception { POA rootPOA = (POA)orb.resolve_initial_references("RootPOA"/*#Frozen*/); tpolicy[0] = rootPOA.create_lifespan_policy(LifespanPolicyValue.PERSISTENT); tpolicy[1] = rootPOA.create_request_processing_policy(RequestProcessingPolicyValue.USE_SERVANT_MANAGER); CRpoa = rootPOA.create_POA("com.sun.jts.CosTransactions.CoordinatorResourcePOA"/*#Frozen*/, null, tpolicy); CRpoa.the_POAManager().activate(); RCpoa.the_POAManager().activate(); Cpoa.the_POAManager().activate(); rootPOA.the_POAManager().activate();
rootPOA.the_POAManager().activate(); 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( nsPOA = rootPOA.create_POA("NameService", null, poaPolicy); nsPOA.the_POAManager().activate( );
POA rootPOA = (POA) orb.resolve_initial_references( ORBConstants.ROOT_POA_NAME ); rootPOA.the_POAManager().activate(); 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( POA nsPOA = rootPOA.create_POA( "TNameService", null, poaPolicy ); nsPOA.the_POAManager().activate();
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); }
/** * 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 void shutdown( boolean waitForCompletion ) { // It is important to copy the list of POAManagers first because // pm.deactivate removes itself from poaManagers! Iterator managers = null ; synchronized (this) { isShuttingDown = true ; managers = (new HashSet(poaManagers)).iterator(); } while ( managers.hasNext() ) { try { ((POAManager)managers.next()).deactivate(true, waitForCompletion); } catch ( org.omg.PortableServer.POAManagerPackage.AdapterInactive e ) {} } }
/** * blocks the request controller thread if the queue is empty, * the poa is in holding state or waitForShutdown was called, * if waitForShutdown was called the RequestController loop blocks for * ALL TIME in this method (the poa behaves as if he is in holding state now) */ private void waitForQueue() { if (logger.isDebugEnabled()) { logger.debug("waiting for queue"); } synchronized (queueLog) { while ((requestQueue.isEmpty() || POAUtil.isHolding (poa.the_POAManager().get_state()) || waitForShutdownCalled) && !terminate) { try { queueLog.wait(); } catch (java.lang.InterruptedException e) { // ignored } } } }
if (managers[i].get_id().equals("RootPOAManager")) { manager = (org.apache.yoko.orb.OBPortableServer.POAManager) managers[i]; break;