/** * Given any Tie, return the corresponding object refernce, activating the Servant if necessary. */ public static org.omg.CORBA.Object activateTie(Tie tie) { /** * Any implementation of Tie should be either a Servant or an ObjectImpl, depending on which style of code * generation is used. rmic -iiop by default results in an ObjectImpl-based Tie, while rmic -iiop -poa results * in a Servant-based Tie. Dynamic RMI-IIOP also uses Servant-based Ties (see * impl.presentation.rmi.ReflectiveTie). */ if (tie instanceof ObjectImpl) { return tie.thisObject(); } else if (tie instanceof Servant) { Servant servant = (Servant) tie; return activateServant(servant); } else { throw wrapper.badActivateTieCall(); } }
if (StubAdapter.isStub(obj)) StubAdapter.getDelegate(obj); StubAdapter.connect(obj, orb); return StubAdapter.activateTie(theTie);
/** * Connect the Stub to the ORB. */ protected final Object resolveObject(Object obj) throws IOException { try { if (StubAdapter.isStub(obj)) { StubAdapter.connect(obj, orb); } } catch (java.rmi.RemoteException re) { IOException ie = new IOException("resolveObject failed"); ie.initCause(re); throw ie; } return obj; } }
/** * This also gets the delegate from a Servant by using Servant._this_object() */ public static Delegate getDelegate(Object stub) { if (stub instanceof DynamicStub) return ((DynamicStub) stub).getDelegate(); else if (stub instanceof ObjectImpl) return ((ObjectImpl) stub)._get_delegate(); else if (stub instanceof Tie) { Tie tie = (Tie) stub; org.omg.CORBA.Object ref = activateTie(tie); return getDelegate(ref); } else throw wrapper.getDelegateRequiresStub(); }
/** * See the description of the <a href="#anyOps">general Any operations.</a> */ public void insert_Object(org.omg.CORBA.Object o) { // debug.log ("insert_Object"); if (o == null) { typeCode = orb.get_primitive_tc(TCKind._tk_objref); } else { if (StubAdapter.isStub(o)) { String[] ids = StubAdapter.getTypeIds(o); typeCode = new TypeCodeImpl(orb, TCKind._tk_objref, ids[0], ""); } else { throw wrapper.badInsertobjParam(CompletionStatus.COMPLETED_MAYBE, o.getClass().getName()); } } object = o; isInitialized = true; }
boolean tieIsStub = StubAdapter.isStub(tie); if (tieIsStub) ids = StubAdapter.getTypeIds(tie); Delegate del = StubAdapter.getDelegate(tie); StubAdapter.setDelegate(stub, del); Delegate delegate = StubAdapter.getDelegate(tie); StubAdapter.setDelegate(stub, delegate);
&& !StubAdapter.getTypeIds(entry.stub)[0].equals(stubFactory.getTypeIds()[0])) StubAdapter.getDelegate(entry.stub); Delegate del = StubAdapter.getDelegate(tie); StubAdapter.setDelegate(entry.stub, del);
Delegate delegate = StubAdapter.getDelegate(narrowFrom); codebase = ((org.omg.CORBA_2_3.portable.Delegate) delegate).get_codebase(narrowFrom); classLoader); result = sf.makeStub(); StubAdapter.setDelegate(result, StubAdapter.getDelegate(narrowFrom));
private boolean isLocal() { boolean result = false; Delegate delegate = StubAdapter.getDelegate(stub); if (delegate instanceof CorbaClientDelegate) { CorbaClientDelegate cdel = (CorbaClientDelegate) delegate; ContactInfoList cil = cdel.getContactInfoList(); if (cil instanceof CorbaContactInfoList) { CorbaContactInfoList ccil = (CorbaContactInfoList) cil; LocalClientRequestDispatcher lcrd = ccil.getLocalClientRequestDispatcher(); result = lcrd.useLocalInvocation(null); } } return result; }
if (StubAdapter.isStub(obj)) org.omg.CORBA.portable.Delegate del = StubAdapter.getDelegate(obj);
/** * Checks for objects that are instances of java.rmi.Remote that need to be serialized as proxy (Stub) objects. */ protected final Object replaceObject(Object obj) throws IOException { try { if ((obj instanceof java.rmi.Remote) && !(StubAdapter.isStub(obj))) { return Utility.autoConnect(obj, orb, true); } } catch (Exception e) { IOException ie = new IOException("replaceObject failed"); ie.initCause(e); throw ie; } return obj; } }
/** * This method is used to create untyped object references. */ public static org.omg.CORBA.Object makeObjectReference(IOR ior) { CorbaClientDelegate del = makeClientDelegate(ior); org.omg.CORBA.Object objectImpl = new CORBAObjectImpl(); StubAdapter.setDelegate(objectImpl, del); return objectImpl; }
else if (StubAdapter.isStubClass(clz))
public synchronized String[] getTypeIds() { if (typeIds == null) { if (classData == null) { org.omg.CORBA.Object stub = makeStub(); typeIds = StubAdapter.getTypeIds(stub); } else { typeIds = classData.getTypeIds(); } } return typeIds; } }
public StubIORImpl(org.omg.CORBA.Object obj) { // write the IOR to an OutputStream and get an InputStream OutputStream ostr = StubAdapter.getORB(obj).create_output_stream(); ostr.write_Object(obj); InputStream istr = ostr.create_input_stream(); // read the IOR components back from the stream int typeLength = istr.read_long(); typeData = new byte[typeLength]; istr.read_octet_array(typeData, 0, typeLength); int numProfiles = istr.read_long(); profileTags = new int[numProfiles]; profileData = new byte[numProfiles][]; for (int i = 0; i < numProfiles; i++) { profileTags[i] = istr.read_long(); profileData[i] = new byte[istr.read_long()]; istr.read_octet_array(profileData[i], 0, profileData[i].length); } }
boolean tieIsStub = StubAdapter.isStub(tie); if (tieIsStub) ids = StubAdapter.getTypeIds(tie); Delegate del = StubAdapter.getDelegate(tie); StubAdapter.setDelegate(stub, del); Delegate delegate = StubAdapter.getDelegate(tie); StubAdapter.setDelegate(stub, delegate);
&& !StubAdapter.getTypeIds(entry.stub)[0].equals(stubFactory.getTypeIds()[0])) StubAdapter.getDelegate(entry.stub); Delegate del = StubAdapter.getDelegate(tie); StubAdapter.setDelegate(entry.stub, del);
/** * Connect the Stub to the ORB. */ protected final Object resolveObject(Object obj) throws IOException { try { if (StubAdapter.isStub(obj)) { StubAdapter.connect(obj, orb); } } catch (java.rmi.RemoteException re) { IOException ie = new IOException("resolveObject failed"); ie.initCause(re); throw ie; } return obj; } }
Delegate delegate = StubAdapter.getDelegate(narrowFrom); codebase = ((org.omg.CORBA_2_3.portable.Delegate) delegate).get_codebase(narrowFrom); classLoader); result = sf.makeStub(); StubAdapter.setDelegate(result, StubAdapter.getDelegate(narrowFrom));