public static Remote string_to_remote(final String ior) throws NamingException { return (Remote) PortableRemoteObject.narrow( getORB().string_to_object(ior), Remote.class); } }
@SuppressWarnings("unchecked") private Object readResolve() throws ObjectStreamException { CMIReference ref = getReference(); if(ref.getServerRef().getProtocol().equals("iiop")) { T remote; try { remote = (T) Utility.string_to_remote(ior); } catch (NamingException e) { throw new InvalidObjectException("Cannot get the stub from the ior " + ior); } return new RemoteCMIReferenceableWrapper<T>(ref, remote); } else { return this; } }
private Object writeReplace() throws ObjectStreamException { CMIReference ref = getReference(); if(ref.getServerRef().getProtocol().equals("iiop")) { String ior; try { ior = Utility.remote_to_string(getReferencedObject()); } catch (NamingException e) { throw new InvalidObjectException("Cannot get the ior from the stub " + getReferencedObject()); } return new RemoteCMIReferenceableWrapper<T>(ref, ior); } else { return this; } }
public static String remote_to_string(final Remote remote) throws NamingException { Servant servant = (Servant) Util.getTie(remote); org.omg.CORBA.Object o = servant._this_object(); return getORB().object_to_string(o); }