com.sun.corba.se.spi.presentation.rmi.StubAdapter Java Examples

The following examples show how to use com.sun.corba.se.spi.presentation.rmi.StubAdapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CorbaClientDelegateImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This method overrides the org.omg.CORBA.portable.Delegate.equals method,
 * and does the equality check based on IOR equality.
 */
public boolean equals(org.omg.CORBA.Object self, java.lang.Object other)
{
    if (other == null)
        return false ;

    if (!StubAdapter.isStub(other)) {
        return false;
    }

    Delegate delegate = StubAdapter.getDelegate( other ) ;
    if (delegate == null)
        return false ;

    if (delegate instanceof CorbaClientDelegateImpl) {
        CorbaClientDelegateImpl otherDel = (CorbaClientDelegateImpl)
            delegate ;
        IOR otherIor = otherDel.contactInfoList.getTargetIOR();
        return this.contactInfoList.getTargetIOR().equals(otherIor);
    }

    // Come here if other is not implemented by our ORB.
    return false;
}
 
Example #2
Source File: StubIORImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public Delegate getDelegate( ORB orb )
{
    // write the IOR components to an org.omg.CORBA.portable.OutputStream
    OutputStream ostr = orb.create_output_stream();
    ostr.write_long(typeData.length);
    ostr.write_octet_array(typeData, 0, typeData.length);
    ostr.write_long(profileTags.length);
    for (int i = 0; i < profileTags.length; i++) {
        ostr.write_long(profileTags[i]);
        ostr.write_long(profileData[i].length);
        ostr.write_octet_array(profileData[i], 0, profileData[i].length);
    }

    InputStream istr = ostr.create_input_stream() ;

    // read the IOR back from the stream
    org.omg.CORBA.Object obj = (org.omg.CORBA.Object)istr.read_Object();
    return StubAdapter.getDelegate( obj ) ;
}
 
Example #3
Source File: PortableRemoteObject.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
Example #4
Source File: AnyImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #5
Source File: AnyImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #6
Source File: PortableRemoteObject.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
Example #7
Source File: StubInvocationHandlerImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
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 ;
}
 
Example #8
Source File: CorbaClientDelegateImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This method overrides the org.omg.CORBA.portable.Delegate.equals method,
 * and does the equality check based on IOR equality.
 */
public boolean equals(org.omg.CORBA.Object self, java.lang.Object other)
{
    if (other == null)
        return false ;

    if (!StubAdapter.isStub(other)) {
        return false;
    }

    Delegate delegate = StubAdapter.getDelegate( other ) ;
    if (delegate == null)
        return false ;

    if (delegate instanceof CorbaClientDelegateImpl) {
        CorbaClientDelegateImpl otherDel = (CorbaClientDelegateImpl)
            delegate ;
        IOR otherIor = otherDel.contactInfoList.getTargetIOR();
        return this.contactInfoList.getTargetIOR().equals(otherIor);
    }

    // Come here if other is not implemented by our ORB.
    return false;
}
 
Example #9
Source File: TOAImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void disconnect( org.omg.CORBA.Object objref )
{
    // Get the delegate, then ior, then transientKey, then delete servant
    org.omg.CORBA.portable.Delegate del = StubAdapter.getDelegate(
        objref ) ;
    CorbaContactInfoList ccil = (CorbaContactInfoList)
        ((ClientDelegate)del).getContactInfoList() ;
    LocalClientRequestDispatcher lcs =
        ccil.getLocalClientRequestDispatcher() ;

    if (lcs instanceof JIDLLocalCRDImpl) {
        JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
        byte[] oid = jlcs.getObjectId() ;
        servants.deleteServant(oid);
        jlcs.unexport() ;
    } else {
        throw new RuntimeException(
            "TOAImpl.disconnect can not be called on " + lcs ) ;
    }
}
 
Example #10
Source File: TOAImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public void disconnect( org.omg.CORBA.Object objref )
{
    // Get the delegate, then ior, then transientKey, then delete servant
    org.omg.CORBA.portable.Delegate del = StubAdapter.getDelegate(
        objref ) ;
    CorbaContactInfoList ccil = (CorbaContactInfoList)
        ((ClientDelegate)del).getContactInfoList() ;
    LocalClientRequestDispatcher lcs =
        ccil.getLocalClientRequestDispatcher() ;

    if (lcs instanceof JIDLLocalCRDImpl) {
        JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
        byte[] oid = jlcs.getObjectId() ;
        servants.deleteServant(oid);
        jlcs.unexport() ;
    } else {
        throw new RuntimeException(
            "TOAImpl.disconnect can not be called on " + lcs ) ;
    }
}
 
Example #11
Source File: StubInvocationHandlerImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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 ;
}
 
Example #12
Source File: ORBUtility.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/** Obtains an IOR for the object reference obj, first connecting it to
* the ORB if necessary.
* @return IOR the IOR that represents this objref.  This will
* never be null.
* @exception BAD_OPERATION if the object could not be connected,
* if a connection attempt was needed.
* @exception BAD_PARAM if obj is a local object, or else was
* created by a foreign ORB.
*/
public static IOR connectAndGetIOR( ORB orb, org.omg.CORBA.Object obj )
{
    IOR result ;
    try {
        result = getIOR( obj ) ;
    } catch (BAD_OPERATION bop) {
        if (StubAdapter.isStub(obj)) {
            try {
                StubAdapter.connect( obj, orb ) ;
            } catch (java.rmi.RemoteException exc) {
                throw wrapper.connectingServant( exc ) ;
            }
        } else {
            orb.connect( obj ) ;
        }

        result = getIOR( obj ) ;
    }

    return result ;
}
 
Example #13
Source File: AnyImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #14
Source File: StubIORImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public Delegate getDelegate( ORB orb )
{
    // write the IOR components to an org.omg.CORBA.portable.OutputStream
    OutputStream ostr = orb.create_output_stream();
    ostr.write_long(typeData.length);
    ostr.write_octet_array(typeData, 0, typeData.length);
    ostr.write_long(profileTags.length);
    for (int i = 0; i < profileTags.length; i++) {
        ostr.write_long(profileTags[i]);
        ostr.write_long(profileData[i].length);
        ostr.write_octet_array(profileData[i], 0, profileData[i].length);
    }

    InputStream istr = ostr.create_input_stream() ;

    // read the IOR back from the stream
    org.omg.CORBA.Object obj = (org.omg.CORBA.Object)istr.read_Object();
    return StubAdapter.getDelegate( obj ) ;
}
 
Example #15
Source File: StubIORImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
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);
    }
}
 
Example #16
Source File: AnyImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #17
Source File: StubInvocationHandlerImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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 ;
}
 
Example #18
Source File: StubIORImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public Delegate getDelegate( ORB orb )
{
    // write the IOR components to an org.omg.CORBA.portable.OutputStream
    OutputStream ostr = orb.create_output_stream();
    ostr.write_long(typeData.length);
    ostr.write_octet_array(typeData, 0, typeData.length);
    ostr.write_long(profileTags.length);
    for (int i = 0; i < profileTags.length; i++) {
        ostr.write_long(profileTags[i]);
        ostr.write_long(profileData[i].length);
        ostr.write_octet_array(profileData[i], 0, profileData[i].length);
    }

    InputStream istr = ostr.create_input_stream() ;

    // read the IOR back from the stream
    org.omg.CORBA.Object obj = (org.omg.CORBA.Object)istr.read_Object();
    return StubAdapter.getDelegate( obj ) ;
}
 
Example #19
Source File: CorbaClientDelegateImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * This method overrides the org.omg.CORBA.portable.Delegate.equals method,
 * and does the equality check based on IOR equality.
 */
public boolean equals(org.omg.CORBA.Object self, java.lang.Object other)
{
    if (other == null)
        return false ;

    if (!StubAdapter.isStub(other)) {
        return false;
    }

    Delegate delegate = StubAdapter.getDelegate( other ) ;
    if (delegate == null)
        return false ;

    if (delegate instanceof CorbaClientDelegateImpl) {
        CorbaClientDelegateImpl otherDel = (CorbaClientDelegateImpl)
            delegate ;
        IOR otherIor = otherDel.contactInfoList.getTargetIOR();
        return this.contactInfoList.getTargetIOR().equals(otherIor);
    }

    // Come here if other is not implemented by our ORB.
    return false;
}
 
Example #20
Source File: CorbaClientDelegateImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This method overrides the org.omg.CORBA.portable.Delegate.equals method,
 * and does the equality check based on IOR equality.
 */
public boolean equals(org.omg.CORBA.Object self, java.lang.Object other)
{
    if (other == null)
        return false ;

    if (!StubAdapter.isStub(other)) {
        return false;
    }

    Delegate delegate = StubAdapter.getDelegate( other ) ;
    if (delegate == null)
        return false ;

    if (delegate instanceof CorbaClientDelegateImpl) {
        CorbaClientDelegateImpl otherDel = (CorbaClientDelegateImpl)
            delegate ;
        IOR otherIor = otherDel.contactInfoList.getTargetIOR();
        return this.contactInfoList.getTargetIOR().equals(otherIor);
    }

    // Come here if other is not implemented by our ORB.
    return false;
}
 
Example #21
Source File: CorbaClientDelegateImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This method overrides the org.omg.CORBA.portable.Delegate.equals method,
 * and does the equality check based on IOR equality.
 */
public boolean equals(org.omg.CORBA.Object self, java.lang.Object other)
{
    if (other == null)
        return false ;

    if (!StubAdapter.isStub(other)) {
        return false;
    }

    Delegate delegate = StubAdapter.getDelegate( other ) ;
    if (delegate == null)
        return false ;

    if (delegate instanceof CorbaClientDelegateImpl) {
        CorbaClientDelegateImpl otherDel = (CorbaClientDelegateImpl)
            delegate ;
        IOR otherIor = otherDel.contactInfoList.getTargetIOR();
        return this.contactInfoList.getTargetIOR().equals(otherIor);
    }

    // Come here if other is not implemented by our ORB.
    return false;
}
 
Example #22
Source File: StubIORImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example #23
Source File: TOAImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void disconnect( org.omg.CORBA.Object objref )
{
    // Get the delegate, then ior, then transientKey, then delete servant
    org.omg.CORBA.portable.Delegate del = StubAdapter.getDelegate(
        objref ) ;
    CorbaContactInfoList ccil = (CorbaContactInfoList)
        ((ClientDelegate)del).getContactInfoList() ;
    LocalClientRequestDispatcher lcs =
        ccil.getLocalClientRequestDispatcher() ;

    if (lcs instanceof JIDLLocalCRDImpl) {
        JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
        byte[] oid = jlcs.getObjectId() ;
        servants.deleteServant(oid);
        jlcs.unexport() ;
    } else {
        throw new RuntimeException(
            "TOAImpl.disconnect can not be called on " + lcs ) ;
    }
}
 
Example #24
Source File: PortableRemoteObject.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
Example #25
Source File: StubInvocationHandlerImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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 ;
}
 
Example #26
Source File: AnyImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #27
Source File: StubIORImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public Delegate getDelegate( ORB orb )
{
    // write the IOR components to an org.omg.CORBA.portable.OutputStream
    OutputStream ostr = orb.create_output_stream();
    ostr.write_long(typeData.length);
    ostr.write_octet_array(typeData, 0, typeData.length);
    ostr.write_long(profileTags.length);
    for (int i = 0; i < profileTags.length; i++) {
        ostr.write_long(profileTags[i]);
        ostr.write_long(profileData[i].length);
        ostr.write_octet_array(profileData[i], 0, profileData[i].length);
    }

    InputStream istr = ostr.create_input_stream() ;

    // read the IOR back from the stream
    org.omg.CORBA.Object obj = (org.omg.CORBA.Object)istr.read_Object();
    return StubAdapter.getDelegate( obj ) ;
}
 
Example #28
Source File: TOAImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void disconnect( org.omg.CORBA.Object objref )
{
    // Get the delegate, then ior, then transientKey, then delete servant
    org.omg.CORBA.portable.Delegate del = StubAdapter.getDelegate(
        objref ) ;
    CorbaContactInfoList ccil = (CorbaContactInfoList)
        ((ClientDelegate)del).getContactInfoList() ;
    LocalClientRequestDispatcher lcs =
        ccil.getLocalClientRequestDispatcher() ;

    if (lcs instanceof JIDLLocalCRDImpl) {
        JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
        byte[] oid = jlcs.getObjectId() ;
        servants.deleteServant(oid);
        jlcs.unexport() ;
    } else {
        throw new RuntimeException(
            "TOAImpl.disconnect can not be called on " + lcs ) ;
    }
}
 
Example #29
Source File: ORBUtility.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/** Obtains an IOR for the object reference obj, first connecting it to
* the ORB if necessary.
* @return IOR the IOR that represents this objref.  This will
* never be null.
* @exception BAD_OPERATION if the object could not be connected,
* if a connection attempt was needed.
* @exception BAD_PARAM if obj is a local object, or else was
* created by a foreign ORB.
*/
public static IOR connectAndGetIOR( ORB orb, org.omg.CORBA.Object obj )
{
    IOR result ;
    try {
        result = getIOR( obj ) ;
    } catch (BAD_OPERATION bop) {
        if (StubAdapter.isStub(obj)) {
            try {
                StubAdapter.connect( obj, orb ) ;
            } catch (java.rmi.RemoteException exc) {
                throw wrapper.connectingServant( exc ) ;
            }
        } else {
            orb.connect( obj ) ;
        }

        result = getIOR( obj ) ;
    }

    return result ;
}
 
Example #30
Source File: CorbaClientDelegateImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This method overrides the org.omg.CORBA.portable.Delegate.equals method,
 * and does the equality check based on IOR equality.
 */
public boolean equals(org.omg.CORBA.Object self, java.lang.Object other)
{
    if (other == null)
        return false ;

    if (!StubAdapter.isStub(other)) {
        return false;
    }

    Delegate delegate = StubAdapter.getDelegate( other ) ;
    if (delegate == null)
        return false ;

    if (delegate instanceof CorbaClientDelegateImpl) {
        CorbaClientDelegateImpl otherDel = (CorbaClientDelegateImpl)
            delegate ;
        IOR otherIor = otherDel.contactInfoList.getTargetIOR();
        return this.contactInfoList.getTargetIOR().equals(otherIor);
    }

    // Come here if other is not implemented by our ORB.
    return false;
}