com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher Java Examples

The following examples show how to use com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher. 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: 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 #2
Source File: TOAImpl.java    From jdk1.8-source-analysis with Apache License 2.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 #3
Source File: StubInvocationHandlerImpl.java    From openjdk-8 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 #4
Source File: StubInvocationHandlerImpl.java    From jdk1.8-source-analysis with Apache License 2.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 #5
Source File: CorbaContactInfoListImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * setLocalSubcontract sets cached information that is set whenever
 * the effectiveTargetIOR changes.
 *
 * Note: this must be maintained accurately whether or not the ORB
 * allows local optimization, because ServantManagers in the POA
 * ALWAYS use local optimization ONLY (they do not have a remote case).
 */
protected void setLocalSubcontract()
{
    if (!effectiveTargetIOR.getProfile().isLocal()) {
        LocalClientRequestDispatcher = new NotLocalLocalCRDImpl();
        return;
    }

    // XXX Note that this always uses the first IIOP profile to get the
    // scid.  What about multi-profile IORs?  This should perhaps be
    // tied to the current ContactInfo in some way, together with an
    // implementation of ClientDelegate that generally prefers co-located
    // ContactInfo.  This may in fact mean that we should do this at
    // the ContactInfo level, rather than the IOR/profile level.
    int scid = effectiveTargetIOR.getProfile().getObjectKeyTemplate().
        getSubcontractId() ;
    LocalClientRequestDispatcherFactory lcsf = orb.getRequestDispatcherRegistry().getLocalClientRequestDispatcherFactory( scid ) ;
    LocalClientRequestDispatcher = lcsf.create( scid, effectiveTargetIOR ) ;
}
 
Example #6
Source File: Util.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * The <tt>isLocal</tt> method has the same semantics as the
 * ObjectImpl._is_local method, except that it can throw a RemoteException.
 * (no it doesn't but the spec says it should.)
 *
 * The <tt>_is_local()</tt> method is provided so that stubs may determine
 * if a particular object is implemented by a local servant and hence local
 * invocation APIs may be used.
 *
 * @param stub the stub to test.
 *
 * @return The <tt>_is_local()</tt> method returns true if
 * the servant incarnating the object is located in the same process as
 * the stub and they both share the same ORB instance.  The <tt>_is_local()</tt>
 * method returns false otherwise. The default behavior of <tt>_is_local()</tt> is
 * to return false.
 *
 * @throws RemoteException The Java to IDL specification does to
 * specify the conditions that cause a RemoteException to be thrown.
 */
public boolean isLocal(javax.rmi.CORBA.Stub stub) throws RemoteException
{
    boolean result = false ;

    try {
        org.omg.CORBA.portable.Delegate delegate = stub._get_delegate() ;
        if (delegate instanceof CorbaClientDelegate) {
            // For the Sun ORB
            CorbaClientDelegate cdel = (CorbaClientDelegate)delegate ;
            ContactInfoList cil = cdel.getContactInfoList() ;
            if (cil instanceof CorbaContactInfoList) {
                CorbaContactInfoList ccil = (CorbaContactInfoList)cil ;
                LocalClientRequestDispatcher lcs = ccil.getLocalClientRequestDispatcher() ;
                result = lcs.useLocalInvocation( null ) ;
            }
        } else {
            // For a non-Sun ORB
            result = delegate.is_local( stub ) ;
        }
    } catch (SystemException e) {
        throw javax.rmi.CORBA.Util.mapSystemException(e);
    }

    return result ;
}
 
Example #7
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 #8
Source File: Util.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * The <tt>isLocal</tt> method has the same semantics as the
 * ObjectImpl._is_local method, except that it can throw a RemoteException.
 * (no it doesn't but the spec says it should.)
 *
 * The <tt>_is_local()</tt> method is provided so that stubs may determine
 * if a particular object is implemented by a local servant and hence local
 * invocation APIs may be used.
 *
 * @param stub the stub to test.
 *
 * @return The <tt>_is_local()</tt> method returns true if
 * the servant incarnating the object is located in the same process as
 * the stub and they both share the same ORB instance.  The <tt>_is_local()</tt>
 * method returns false otherwise. The default behavior of <tt>_is_local()</tt> is
 * to return false.
 *
 * @throws RemoteException The Java to IDL specification does to
 * specify the conditions that cause a RemoteException to be thrown.
 */
public boolean isLocal(javax.rmi.CORBA.Stub stub) throws RemoteException
{
    boolean result = false ;

    try {
        org.omg.CORBA.portable.Delegate delegate = stub._get_delegate() ;
        if (delegate instanceof CorbaClientDelegate) {
            // For the Sun ORB
            CorbaClientDelegate cdel = (CorbaClientDelegate)delegate ;
            ContactInfoList cil = cdel.getContactInfoList() ;
            if (cil instanceof CorbaContactInfoList) {
                CorbaContactInfoList ccil = (CorbaContactInfoList)cil ;
                LocalClientRequestDispatcher lcs = ccil.getLocalClientRequestDispatcher() ;
                result = lcs.useLocalInvocation( null ) ;
            }
        } else {
            // For a non-Sun ORB
            result = delegate.is_local( stub ) ;
        }
    } catch (SystemException e) {
        throw javax.rmi.CORBA.Util.mapSystemException(e);
    }

    return result ;
}
 
Example #9
Source File: StubInvocationHandlerImpl.java    From TencentKona-8 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 #10
Source File: TOAImpl.java    From openjdk-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 #11
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 #12
Source File: Util.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * The <tt>isLocal</tt> method has the same semantics as the
 * ObjectImpl._is_local method, except that it can throw a RemoteException.
 * (no it doesn't but the spec says it should.)
 *
 * The <tt>_is_local()</tt> method is provided so that stubs may determine
 * if a particular object is implemented by a local servant and hence local
 * invocation APIs may be used.
 *
 * @param stub the stub to test.
 *
 * @return The <tt>_is_local()</tt> method returns true if
 * the servant incarnating the object is located in the same process as
 * the stub and they both share the same ORB instance.  The <tt>_is_local()</tt>
 * method returns false otherwise. The default behavior of <tt>_is_local()</tt> is
 * to return false.
 *
 * @throws RemoteException The Java to IDL specification does to
 * specify the conditions that cause a RemoteException to be thrown.
 */
public boolean isLocal(javax.rmi.CORBA.Stub stub) throws RemoteException
{
    boolean result = false ;

    try {
        org.omg.CORBA.portable.Delegate delegate = stub._get_delegate() ;
        if (delegate instanceof CorbaClientDelegate) {
            // For the Sun ORB
            CorbaClientDelegate cdel = (CorbaClientDelegate)delegate ;
            ContactInfoList cil = cdel.getContactInfoList() ;
            if (cil instanceof CorbaContactInfoList) {
                CorbaContactInfoList ccil = (CorbaContactInfoList)cil ;
                LocalClientRequestDispatcher lcs = ccil.getLocalClientRequestDispatcher() ;
                result = lcs.useLocalInvocation( null ) ;
            }
        } else {
            // For a non-Sun ORB
            result = delegate.is_local( stub ) ;
        }
    } catch (SystemException e) {
        throw javax.rmi.CORBA.Util.mapSystemException(e);
    }

    return result ;
}
 
Example #13
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 #14
Source File: CorbaContactInfoListImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * setLocalSubcontract sets cached information that is set whenever
 * the effectiveTargetIOR changes.
 *
 * Note: this must be maintained accurately whether or not the ORB
 * allows local optimization, because ServantManagers in the POA
 * ALWAYS use local optimization ONLY (they do not have a remote case).
 */
protected void setLocalSubcontract()
{
    if (!effectiveTargetIOR.getProfile().isLocal()) {
        LocalClientRequestDispatcher = new NotLocalLocalCRDImpl();
        return;
    }

    // XXX Note that this always uses the first IIOP profile to get the
    // scid.  What about multi-profile IORs?  This should perhaps be
    // tied to the current ContactInfo in some way, together with an
    // implementation of ClientDelegate that generally prefers co-located
    // ContactInfo.  This may in fact mean that we should do this at
    // the ContactInfo level, rather than the IOR/profile level.
    int scid = effectiveTargetIOR.getProfile().getObjectKeyTemplate().
        getSubcontractId() ;
    LocalClientRequestDispatcherFactory lcsf = orb.getRequestDispatcherRegistry().getLocalClientRequestDispatcherFactory( scid ) ;
    LocalClientRequestDispatcher = lcsf.create( scid, effectiveTargetIOR ) ;
}
 
Example #15
Source File: CorbaContactInfoListImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * setLocalSubcontract sets cached information that is set whenever
 * the effectiveTargetIOR changes.
 *
 * Note: this must be maintained accurately whether or not the ORB
 * allows local optimization, because ServantManagers in the POA
 * ALWAYS use local optimization ONLY (they do not have a remote case).
 */
protected void setLocalSubcontract()
{
    if (!effectiveTargetIOR.getProfile().isLocal()) {
        LocalClientRequestDispatcher = new NotLocalLocalCRDImpl();
        return;
    }

    // XXX Note that this always uses the first IIOP profile to get the
    // scid.  What about multi-profile IORs?  This should perhaps be
    // tied to the current ContactInfo in some way, together with an
    // implementation of ClientDelegate that generally prefers co-located
    // ContactInfo.  This may in fact mean that we should do this at
    // the ContactInfo level, rather than the IOR/profile level.
    int scid = effectiveTargetIOR.getProfile().getObjectKeyTemplate().
        getSubcontractId() ;
    LocalClientRequestDispatcherFactory lcsf = orb.getRequestDispatcherRegistry().getLocalClientRequestDispatcherFactory( scid ) ;
    LocalClientRequestDispatcher = lcsf.create( scid, effectiveTargetIOR ) ;
}
 
Example #16
Source File: CorbaContactInfoListImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * setLocalSubcontract sets cached information that is set whenever
 * the effectiveTargetIOR changes.
 *
 * Note: this must be maintained accurately whether or not the ORB
 * allows local optimization, because ServantManagers in the POA
 * ALWAYS use local optimization ONLY (they do not have a remote case).
 */
protected void setLocalSubcontract()
{
    if (!effectiveTargetIOR.getProfile().isLocal()) {
        LocalClientRequestDispatcher = new NotLocalLocalCRDImpl();
        return;
    }

    // XXX Note that this always uses the first IIOP profile to get the
    // scid.  What about multi-profile IORs?  This should perhaps be
    // tied to the current ContactInfo in some way, together with an
    // implementation of ClientDelegate that generally prefers co-located
    // ContactInfo.  This may in fact mean that we should do this at
    // the ContactInfo level, rather than the IOR/profile level.
    int scid = effectiveTargetIOR.getProfile().getObjectKeyTemplate().
        getSubcontractId() ;
    LocalClientRequestDispatcherFactory lcsf = orb.getRequestDispatcherRegistry().getLocalClientRequestDispatcherFactory( scid ) ;
    LocalClientRequestDispatcher = lcsf.create( scid, effectiveTargetIOR ) ;
}
 
Example #17
Source File: Util.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * The <tt>isLocal</tt> method has the same semantics as the
 * ObjectImpl._is_local method, except that it can throw a RemoteException.
 * (no it doesn't but the spec says it should.)
 *
 * The <tt>_is_local()</tt> method is provided so that stubs may determine
 * if a particular object is implemented by a local servant and hence local
 * invocation APIs may be used.
 *
 * @param stub the stub to test.
 *
 * @return The <tt>_is_local()</tt> method returns true if
 * the servant incarnating the object is located in the same process as
 * the stub and they both share the same ORB instance.  The <tt>_is_local()</tt>
 * method returns false otherwise. The default behavior of <tt>_is_local()</tt> is
 * to return false.
 *
 * @throws RemoteException The Java to IDL specification does to
 * specify the conditions that cause a RemoteException to be thrown.
 */
public boolean isLocal(javax.rmi.CORBA.Stub stub) throws RemoteException
{
    boolean result = false ;

    try {
        org.omg.CORBA.portable.Delegate delegate = stub._get_delegate() ;
        if (delegate instanceof CorbaClientDelegate) {
            // For the Sun ORB
            CorbaClientDelegate cdel = (CorbaClientDelegate)delegate ;
            ContactInfoList cil = cdel.getContactInfoList() ;
            if (cil instanceof CorbaContactInfoList) {
                CorbaContactInfoList ccil = (CorbaContactInfoList)cil ;
                LocalClientRequestDispatcher lcs = ccil.getLocalClientRequestDispatcher() ;
                result = lcs.useLocalInvocation( null ) ;
            }
        } else {
            // For a non-Sun ORB
            result = delegate.is_local( stub ) ;
        }
    } catch (SystemException e) {
        throw javax.rmi.CORBA.Util.mapSystemException(e);
    }

    return result ;
}
 
Example #18
Source File: TOAImpl.java    From openjdk-jdk8u 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 #19
Source File: Util.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * The <tt>isLocal</tt> method has the same semantics as the
 * ObjectImpl._is_local method, except that it can throw a RemoteException.
 * (no it doesn't but the spec says it should.)
 *
 * The <tt>_is_local()</tt> method is provided so that stubs may determine
 * if a particular object is implemented by a local servant and hence local
 * invocation APIs may be used.
 *
 * @param stub the stub to test.
 *
 * @return The <tt>_is_local()</tt> method returns true if
 * the servant incarnating the object is located in the same process as
 * the stub and they both share the same ORB instance.  The <tt>_is_local()</tt>
 * method returns false otherwise. The default behavior of <tt>_is_local()</tt> is
 * to return false.
 *
 * @throws RemoteException The Java to IDL specification does to
 * specify the conditions that cause a RemoteException to be thrown.
 */
public boolean isLocal(javax.rmi.CORBA.Stub stub) throws RemoteException
{
    boolean result = false ;

    try {
        org.omg.CORBA.portable.Delegate delegate = stub._get_delegate() ;
        if (delegate instanceof CorbaClientDelegate) {
            // For the Sun ORB
            CorbaClientDelegate cdel = (CorbaClientDelegate)delegate ;
            ContactInfoList cil = cdel.getContactInfoList() ;
            if (cil instanceof CorbaContactInfoList) {
                CorbaContactInfoList ccil = (CorbaContactInfoList)cil ;
                LocalClientRequestDispatcher lcs = ccil.getLocalClientRequestDispatcher() ;
                result = lcs.useLocalInvocation( null ) ;
            }
        } else {
            // For a non-Sun ORB
            result = delegate.is_local( stub ) ;
        }
    } catch (SystemException e) {
        throw javax.rmi.CORBA.Util.mapSystemException(e);
    }

    return result ;
}
 
Example #20
Source File: StubInvocationHandlerImpl.java    From openjdk-jdk8u 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 #21
Source File: TOAImpl.java    From hottub 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 #22
Source File: CorbaContactInfoListImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * setLocalSubcontract sets cached information that is set whenever
 * the effectiveTargetIOR changes.
 *
 * Note: this must be maintained accurately whether or not the ORB
 * allows local optimization, because ServantManagers in the POA
 * ALWAYS use local optimization ONLY (they do not have a remote case).
 */
protected void setLocalSubcontract()
{
    if (!effectiveTargetIOR.getProfile().isLocal()) {
        LocalClientRequestDispatcher = new NotLocalLocalCRDImpl();
        return;
    }

    // XXX Note that this always uses the first IIOP profile to get the
    // scid.  What about multi-profile IORs?  This should perhaps be
    // tied to the current ContactInfo in some way, together with an
    // implementation of ClientDelegate that generally prefers co-located
    // ContactInfo.  This may in fact mean that we should do this at
    // the ContactInfo level, rather than the IOR/profile level.
    int scid = effectiveTargetIOR.getProfile().getObjectKeyTemplate().
        getSubcontractId() ;
    LocalClientRequestDispatcherFactory lcsf = orb.getRequestDispatcherRegistry().getLocalClientRequestDispatcherFactory( scid ) ;
    LocalClientRequestDispatcher = lcsf.create( scid, effectiveTargetIOR ) ;
}
 
Example #23
Source File: CorbaContactInfoListImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * setLocalSubcontract sets cached information that is set whenever
 * the effectiveTargetIOR changes.
 *
 * Note: this must be maintained accurately whether or not the ORB
 * allows local optimization, because ServantManagers in the POA
 * ALWAYS use local optimization ONLY (they do not have a remote case).
 */
protected void setLocalSubcontract()
{
    if (!effectiveTargetIOR.getProfile().isLocal()) {
        LocalClientRequestDispatcher = new NotLocalLocalCRDImpl();
        return;
    }

    // XXX Note that this always uses the first IIOP profile to get the
    // scid.  What about multi-profile IORs?  This should perhaps be
    // tied to the current ContactInfo in some way, together with an
    // implementation of ClientDelegate that generally prefers co-located
    // ContactInfo.  This may in fact mean that we should do this at
    // the ContactInfo level, rather than the IOR/profile level.
    int scid = effectiveTargetIOR.getProfile().getObjectKeyTemplate().
        getSubcontractId() ;
    LocalClientRequestDispatcherFactory lcsf = orb.getRequestDispatcherRegistry().getLocalClientRequestDispatcherFactory( scid ) ;
    LocalClientRequestDispatcher = lcsf.create( scid, effectiveTargetIOR ) ;
}
 
Example #24
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 #25
Source File: Util.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * The <tt>isLocal</tt> method has the same semantics as the
 * ObjectImpl._is_local method, except that it can throw a RemoteException.
 * (no it doesn't but the spec says it should.)
 *
 * The <tt>_is_local()</tt> method is provided so that stubs may determine
 * if a particular object is implemented by a local servant and hence local
 * invocation APIs may be used.
 *
 * @param stub the stub to test.
 *
 * @return The <tt>_is_local()</tt> method returns true if
 * the servant incarnating the object is located in the same process as
 * the stub and they both share the same ORB instance.  The <tt>_is_local()</tt>
 * method returns false otherwise. The default behavior of <tt>_is_local()</tt> is
 * to return false.
 *
 * @throws RemoteException The Java to IDL specification does to
 * specify the conditions that cause a RemoteException to be thrown.
 */
public boolean isLocal(javax.rmi.CORBA.Stub stub) throws RemoteException
{
    boolean result = false ;

    try {
        org.omg.CORBA.portable.Delegate delegate = stub._get_delegate() ;
        if (delegate instanceof CorbaClientDelegate) {
            // For the Sun ORB
            CorbaClientDelegate cdel = (CorbaClientDelegate)delegate ;
            ContactInfoList cil = cdel.getContactInfoList() ;
            if (cil instanceof CorbaContactInfoList) {
                CorbaContactInfoList ccil = (CorbaContactInfoList)cil ;
                LocalClientRequestDispatcher lcs = ccil.getLocalClientRequestDispatcher() ;
                result = lcs.useLocalInvocation( null ) ;
            }
        } else {
            // For a non-Sun ORB
            result = delegate.is_local( stub ) ;
        }
    } catch (SystemException e) {
        throw javax.rmi.CORBA.Util.mapSystemException(e);
    }

    return result ;
}
 
Example #26
Source File: StubInvocationHandlerImpl.java    From openjdk-jdk8u-backup 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 #27
Source File: StubInvocationHandlerImpl.java    From openjdk-jdk9 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 #28
Source File: CorbaContactInfoListImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * setLocalSubcontract sets cached information that is set whenever
 * the effectiveTargetIOR changes.
 *
 * Note: this must be maintained accurately whether or not the ORB
 * allows local optimization, because ServantManagers in the POA
 * ALWAYS use local optimization ONLY (they do not have a remote case).
 */
protected void setLocalSubcontract()
{
    if (!effectiveTargetIOR.getProfile().isLocal()) {
        LocalClientRequestDispatcher = new NotLocalLocalCRDImpl();
        return;
    }

    // XXX Note that this always uses the first IIOP profile to get the
    // scid.  What about multi-profile IORs?  This should perhaps be
    // tied to the current ContactInfo in some way, together with an
    // implementation of ClientDelegate that generally prefers co-located
    // ContactInfo.  This may in fact mean that we should do this at
    // the ContactInfo level, rather than the IOR/profile level.
    int scid = effectiveTargetIOR.getProfile().getObjectKeyTemplate().
        getSubcontractId() ;
    LocalClientRequestDispatcherFactory lcsf = orb.getRequestDispatcherRegistry().getLocalClientRequestDispatcherFactory( scid ) ;
    LocalClientRequestDispatcher = lcsf.create( scid, effectiveTargetIOR ) ;
}
 
Example #29
Source File: Util.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * The {@code isLocal} method has the same semantics as the
 * ObjectImpl._is_local method, except that it can throw a RemoteException.
 * (no it doesn't but the spec says it should.)
 *
 * The {@code _is_local()} method is provided so that stubs may determine
 * if a particular object is implemented by a local servant and hence local
 * invocation APIs may be used.
 *
 * @param stub the stub to test.
 *
 * @return The {@code _is_local()} method returns true if
 * the servant incarnating the object is located in the same process as
 * the stub and they both share the same ORB instance.  The {@code _is_local()}
 * method returns false otherwise. The default behavior of {@code _is_local()} is
 * to return false.
 *
 * @throws RemoteException The Java to IDL specification does to
 * specify the conditions that cause a RemoteException to be thrown.
 */
public boolean isLocal(javax.rmi.CORBA.Stub stub) throws RemoteException
{
    boolean result = false ;

    try {
        org.omg.CORBA.portable.Delegate delegate = stub._get_delegate() ;
        if (delegate instanceof CorbaClientDelegate) {
            // For the Sun ORB
            CorbaClientDelegate cdel = (CorbaClientDelegate)delegate ;
            ContactInfoList cil = cdel.getContactInfoList() ;
            if (cil instanceof CorbaContactInfoList) {
                CorbaContactInfoList ccil = (CorbaContactInfoList)cil ;
                LocalClientRequestDispatcher lcs = ccil.getLocalClientRequestDispatcher() ;
                result = lcs.useLocalInvocation( null ) ;
            }
        } else {
            // For a non-Sun ORB
            result = delegate.is_local( stub ) ;
        }
    } catch (SystemException e) {
        throw javax.rmi.CORBA.Util.mapSystemException(e);
    }

    return result ;
}
 
Example #30
Source File: TOAImpl.java    From openjdk-jdk9 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 ) ;
    }
}