protected void exportObject(java.rmi.Remote remote) throws java.rmi.RemoteException { // create servant and tie PortableRemoteObject.exportObject(remote); Tie servantsTie = javax.rmi.CORBA.Util.getTie(remote); // Note: at this point the Tie doesnt have a delegate inside it, // so it is not really "exported". // The following call does orb.connect() which is the real exporting servantsTie.orb(orb); }
protected void exportObject(java.rmi.Remote remote) throws java.rmi.RemoteException { // create servant and tie PortableRemoteObject.exportObject(remote); Tie servantsTie = javax.rmi.CORBA.Util.getTie(remote); // Note: at this point the Tie doesnt have a delegate inside it, // so it is not really "exported". // The following call does orb.connect() which is the real exporting servantsTie.orb(orb); }
tie.orb(orb); obj = PortableRemoteObject.toStub((Remote) obj);
public void unregisterTargetsForORB(org.omg.CORBA.ORB orb) { for (Enumeration<?> e = exportedServants.keys(); e.hasMoreElements();) { java.lang.Object key = e.nextElement(); Remote target = (Remote) (key instanceof Tie ? ((Tie) key).getTarget() : key); // Bug 4476347: BAD_OPERATION is thrown if the ties delegate isn't set. // We can ignore this because it means the tie is not connected to an ORB. try { if (orb == getTie(target).orb()) { try { unexportObject(target); } catch (java.rmi.NoSuchObjectException ex) { // We neglect this exception if at all if it is raised. It is not harmful. } } } catch (BAD_OPERATION bad) { /* Ignore */ } } }
public void unregisterTargetsForORB(org.omg.CORBA.ORB orb) { for (Enumeration e = exportedServants.keys(); e.hasMoreElements(); ) { java.lang.Object key = e.nextElement(); Remote target = (Remote)(key instanceof Tie ? ((Tie)key).getTarget() : key); // Bug 4476347: BAD_OPERATION is thrown if the ties delegate isn't set. // We can ignore this because it means the tie is not connected to an ORB. try { if (orb == getTie(target).orb()) { try { unexportObject(target); } catch( java.rmi.NoSuchObjectException ex ) { // We neglect this exception if at all if it is // raised. It is not harmful. } } } catch (BAD_OPERATION bad) { /* Ignore */ } } }
tie.orb(orb); obj = PortableRemoteObject.toStub((Remote) obj);
public void unregisterTargetsForORB(org.omg.CORBA.ORB orb) { for (Enumeration<?> e = exportedServants.keys(); e.hasMoreElements();) { java.lang.Object key = e.nextElement(); Remote target = (Remote) (key instanceof Tie ? ((Tie) key).getTarget() : key); // Bug 4476347: BAD_OPERATION is thrown if the ties delegate isn't set. // We can ignore this because it means the tie is not connected to an ORB. try { if (orb == getTie(target).orb()) { try { unexportObject(target); } catch (java.rmi.NoSuchObjectException ex) { // We neglect this exception if at all if it is raised. It is not harmful. } } } catch (BAD_OPERATION bad) { /* Ignore */ } } }
/** * Export an RMI object as a CORBA object * @see javax.rmi.CORBA.PortableRemoteObjectDelegate#exportObject(java.rmi.Remote) */ public void exportObject( java.rmi.Remote obj ) throws java.rmi.RemoteException { if (obj == null) { throw new IllegalArgumentException(); } if ( obj instanceof Stub ) { throw new java.rmi.server.ExportException( "Attempted to export a stub class" ); } Tie tie = Util.getTie( obj ); if ( tie != null ) { throw new java.rmi.server.ExportException( "Object already exported" ); } tie = toTie( obj ); tie.orb( getORB() ); Util.registerTarget( tie, obj ); }