try { byte[] oid = rootPoa.activate_object(new BindingIteratorImpl(rest)); o = rootPoa.id_to_reference(oid); } catch (Exception e) {
/** * Create a top-level naming context. * * @param orb The orb hosting this context. * @param poa The POA used to activate the object. * * @exception Exception */ public TransientNamingContext(ORB orb, POA poa) throws Exception { this(orb, poa, null); // now get the initial root context as a corba object. byte[] objectId = poa.activate_object(this); rootContext = poa.id_to_reference(objectId); }
/** * Create a top-level naming context. * * @param orb The orb hosting this context. * @param poa The POA used to activate the object. * * @exception Exception */ public TransientNamingContext(ORB orb, POA poa) throws Exception { this(orb, poa, null); // now get the initial root context as a corba object. byte[] objectId = poa.activate_object(this); rootContext = poa.id_to_reference(objectId); }
public void orb(org.omg.CORBA.ORB orb) { try { POA _poa = POAHelper.narrow(orb .resolve_initial_references("RootPOA")); _poa.activate_object(this); } catch (org.omg.CORBA.ORBPackage.InvalidName ex) { throw new RuntimeException("ORB must have POA support", ex); } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { throw new RuntimeException("wrong policy: " + ex.getMessage(), ex); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { throw new RuntimeException("already active: " + ex.getMessage(), ex); } }
private org.omg.CORBA.portable.ObjectImpl export() { try { if (id != null) { throw new Error("Internal consistency error!"); } id = poa.activate_object(servant); return (org.omg.CORBA.portable.ObjectImpl) poa.id_to_reference(id); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { throw new Error(ex.getMessage(), ex); } catch (org.omg.PortableServer.POAPackage.ObjectNotActive ex) { throw new Error(ex.getMessage(), ex); } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { throw new Error(ex.getMessage(), ex); } }
public org.omg.CosTransactions.Synchronization getCORBAReference() { if (poa == null) { poa = Configuration.getPOA("transient"/*#Frozen*/); } if (corbaRef == null) { try { poa.activate_object(this); corbaRef = SynchronizationHelper.narrow( poa.servant_to_reference(this)); //corbaRef = (org.omg.CosTransactions.Synchronization) this; } catch (Exception ex) { _logger.log(Level.SEVERE, "jts.unexpected_error_in_getcorbareference",ex); } } return corbaRef; }
(com.sun.corba.se.spi.orb.ORB) orb,localRoot, nsPOA); byte[] objectId = nsPOA.activate_object( transContext ); org.omg.CORBA.Object obj = nsPOA.id_to_reference( objectId ); lifecycleLogger.fine( "TransientNamingContext " +
public void exportObject(Remote obj) throws java.rmi.RemoteException { RMIState state = RMIState.current(); try { state.checkShutDown(); } catch (BAD_INV_ORDER ex) { throw new RemoteException("RMIState is deactivated", ex); } Tie tie = javax.rmi.CORBA.Util.getTie(obj); if (tie != null) throw new java.rmi.RemoteException("object already exported"); RMIServant servant = new RMIServant(state); javax.rmi.CORBA.Util.registerTarget(servant, obj); logger.finer("exporting instance of " + obj.getClass().getName() + " in " + state.getName()); try { servant._id = state.getPOA().activate_object(servant); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { throw new java.rmi.RemoteException("internal error: " + ex.getMessage(), ex); } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { throw new java.rmi.RemoteException("internal error: " + ex.getMessage(), ex); } }
/**Returns a CORBA object which represents the transaction. */ synchronized final Coordinator object() { if( thisRef == null ) { if( poa == null ) poa = Configuration.getPOA("Coordinator"/*#Frozen*/); try { poa.activate_object(this); thisRef = CoordinatorHelper.narrow(poa.servant_to_reference(this)); } catch( Exception exc ) { _logger.log(Level.SEVERE,"jts.create_coordinator_object_error",exc); String msg = LogFormatter.getLocalizedMessage(_logger, "jts.create_coordinator_object_error"); throw new org.omg.CORBA.INTERNAL(msg); } } return thisRef; }
_oa.poa(_oaName).activate_object(obj); else invalidPOA = true;
_oa.rootPoa().activate_object(obj);
_oa.poa(_oaName).activate_object(obj); else invalidPOA = true;
_oa.rootPoa().activate_object(obj);
/** * Returns the CORBA Object which represents this object. * * @return The CORBA object. * */ public OTSResource getCORBAObjReference() { if (thisRef == null) { if (Configuration.getORB() == null) { return this; } if (poa == null) { poa = Configuration.getPOA("transient"/*#Frozen*/); } try { poa.activate_object(this); thisRef = OTSResourceHelper. narrow(poa.servant_to_reference(this)); //thisRef = (com.sun.jts.jtsxa.OTSResource)this; } catch (Exception exc) { _logger.log(Level.SEVERE,"jts.create_xaresource_object_error", exc); String msg = LogFormatter.getLocalizedMessage(_logger, "jts.create_xaresource_object_error"); throw new org.omg.CORBA.INTERNAL(msg); } } return thisRef; }
byte[] objectId = poa.activate_object(iterator); org.omg.CORBA.Object obj = poa.id_to_reference(objectId);
/** * 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)); } }
/** * Create a list of bound objects an contexts contained * within this context. * * @param how_many The count of elements to return as a BindingList. * @param bl A holder element for returning the source binding list. * @param bi A holder for returning a BindingIterator. Any extra * elements not returned in the BindingList are returned * in the BindingIterator. * * @exception SystemException */ public synchronized void list(int how_many, org.omg.CosNaming.BindingListHolder bl, org.omg.CosNaming.BindingIteratorHolder bi) throws SystemException { TransientBindingIterator iterator = new TransientBindingIterator(poa, (HashMap)bindings.clone()); // have the iterator fill in the entries here iterator.next_n(how_many, bl); // now it's necessary to activate this iterator with the poa. The value we pass // back is the narrowed activated object try { byte[] objectId = poa.activate_object(iterator); org.omg.CORBA.Object obj = poa.id_to_reference(objectId); bi.value = BindingIteratorHelper.narrow(obj); } catch (SystemException e) { // just propagate system exceptions throw e; } catch (Exception e) { throw (INTERNAL)(new INTERNAL("Unable to activate BindingIterator").initCause(e)); } }
/** * 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)); } }
_oa.poa(_oaName).activate_object(obj); else invalidPOA = true;
public synchronized org.omg.SendingContext.RunTime getRunTimeCodeBase() { logger.finer("getRunTimeCodeBase"); if (codeBase == null) { codeBase = new RunTimeCodeBaseImpl(this); } org.omg.CORBA.ORB orb = RMIState.current().getORB(); org.omg.PortableServer.POA poa = RMIState.current().getPOA(); try { org.omg.CORBA.Object ref = poa.servant_to_reference(codeBase); return org.omg.SendingContext.CodeBaseHelper.narrow(ref); } catch (org.omg.PortableServer.POAPackage.ServantNotActive ex) { // ignore // } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { throw (org.omg.CORBA.INTERNAL)new org.omg.CORBA.INTERNAL("should not happen").initCause(ex); } try { byte[] id = poa.activate_object(codeBase); org.omg.CORBA.Object ref = poa.id_to_reference(id); return org.omg.SendingContext.CodeBaseHelper.narrow(ref); } catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive ex) { throw (org.omg.CORBA.INTERNAL)new org.omg.CORBA.INTERNAL("should not happen").initCause(ex); } catch (org.omg.PortableServer.POAPackage.ObjectNotActive ex) { throw (org.omg.CORBA.INTERNAL)new org.omg.CORBA.INTERNAL("should not happen").initCause(ex); } catch (org.omg.PortableServer.POAPackage.WrongPolicy ex) { throw (org.omg.CORBA.INTERNAL)new org.omg.CORBA.INTERNAL("should not happen").initCause(ex); } }