org.omg.CORBA.portable.ServantObject Java Examples

The following examples show how to use org.omg.CORBA.portable.ServantObject. 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: LocalClientRequestDispatcherBase.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/** Check that the servant in info (which must not be null) is
* an instance of the expectedType.  If not, set the thread local flag
* and return false.
*/
protected boolean checkForCompatibleServant( ServantObject so,
    Class expectedType )
{
    if (so == null)
        return false ;

    // Normally, this test will never fail.  However, if the servant
    // and the stub were loaded in different class loaders, this test
    // will fail.
    if (!expectedType.isInstance( so.servant )) {
        isNextCallValid.set( Boolean.FALSE ) ;

        // When servant_preinvoke returns null, the stub will
        // recursively re-invoke itself.  Thus, the next call made from
        // the stub is another useLocalInvocation call.
        return false ;
    }

    return true ;
}
 
Example #2
Source File: LocalClientRequestDispatcherBase.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/** Check that the servant in info (which must not be null) is
* an instance of the expectedType.  If not, set the thread local flag
* and return false.
*/
protected boolean checkForCompatibleServant( ServantObject so,
    Class expectedType )
{
    if (so == null)
        return false ;

    // Normally, this test will never fail.  However, if the servant
    // and the stub were loaded in different class loaders, this test
    // will fail.
    if (!expectedType.isInstance( so.servant )) {
        isNextCallValid.set( Boolean.FALSE ) ;

        // When servant_preinvoke returns null, the stub will
        // recursively re-invoke itself.  Thus, the next call made from
        // the stub is another useLocalInvocation call.
        return false ;
    }

    return true ;
}
 
Example #3
Source File: LocalClientRequestDispatcherBase.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Check that the servant in info (which must not be null) is
* an instance of the expectedType.  If not, set the thread local flag
* and return false.
*/
protected boolean checkForCompatibleServant( ServantObject so,
    Class expectedType )
{
    if (so == null)
        return false ;

    // Normally, this test will never fail.  However, if the servant
    // and the stub were loaded in different class loaders, this test
    // will fail.
    if (!expectedType.isInstance( so.servant )) {
        isNextCallValid.set( Boolean.FALSE ) ;

        // When servant_preinvoke returns null, the stub will
        // recursively re-invoke itself.  Thus, the next call made from
        // the stub is another useLocalInvocation call.
        return false ;
    }

    return true ;
}
 
Example #4
Source File: FullServantCacheLocalCRDImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
    String operation, Class expectedType )
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    if (!checkForCompatibleServant( cachedInfo, expectedType ))
        return null ;

    // Note that info is shared across multiple threads
    // using the same subcontract, each of which may
    // have its own operation.  Therefore we need to clone it.
    OAInvocationInfo info = new OAInvocationInfo( cachedInfo, operation ) ;
    orb.pushInvocationInfo( info ) ;

    try {
        info.oa().enter() ;
    } catch (OADestroyed pdes) {
        throw wrapper.preinvokePoaDestroyed( pdes ) ;
    }

    return info ;
}
 
Example #5
Source File: FullServantCacheLocalCRDImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
    String operation, Class expectedType )
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    if (!checkForCompatibleServant( cachedInfo, expectedType ))
        return null ;

    // Note that info is shared across multiple threads
    // using the same subcontract, each of which may
    // have its own operation.  Therefore we need to clone it.
    OAInvocationInfo info = new OAInvocationInfo( cachedInfo, operation ) ;
    orb.pushInvocationInfo( info ) ;

    try {
        info.oa().enter() ;
    } catch (OADestroyed pdes) {
        throw wrapper.preinvokePoaDestroyed( pdes ) ;
    }

    return info ;
}
 
Example #6
Source File: FullServantCacheLocalCRDImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
    String operation, Class expectedType )
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    if (!checkForCompatibleServant( cachedInfo, expectedType ))
        return null ;

    // Note that info is shared across multiple threads
    // using the same subcontract, each of which may
    // have its own operation.  Therefore we need to clone it.
    OAInvocationInfo info = new OAInvocationInfo( cachedInfo, operation ) ;
    orb.pushInvocationInfo( info ) ;

    try {
        info.oa().enter() ;
    } catch (OADestroyed pdes) {
        throw wrapper.preinvokePoaDestroyed( pdes ) ;
    }

    return info ;
}
 
Example #7
Source File: FullServantCacheLocalCRDImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
    String operation, Class expectedType )
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    if (!checkForCompatibleServant( cachedInfo, expectedType ))
        return null ;

    // Note that info is shared across multiple threads
    // using the same subcontract, each of which may
    // have its own operation.  Therefore we need to clone it.
    OAInvocationInfo info = new OAInvocationInfo( cachedInfo, operation ) ;
    orb.pushInvocationInfo( info ) ;

    try {
        info.oa().enter() ;
    } catch (OADestroyed pdes) {
        throw wrapper.preinvokePoaDestroyed( pdes ) ;
    }

    return info ;
}
 
Example #8
Source File: LocalClientRequestDispatcherBase.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/** Check that the servant in info (which must not be null) is
* an instance of the expectedType.  If not, set the thread local flag
* and return false.
*/
protected boolean checkForCompatibleServant( ServantObject so,
    Class expectedType )
{
    if (so == null)
        return false ;

    // Normally, this test will never fail.  However, if the servant
    // and the stub were loaded in different class loaders, this test
    // will fail.
    if (!expectedType.isInstance( so.servant )) {
        isNextCallValid.set( Boolean.FALSE ) ;

        // When servant_preinvoke returns null, the stub will
        // recursively re-invoke itself.  Thus, the next call made from
        // the stub is another useLocalInvocation call.
        return false ;
    }

    return true ;
}
 
Example #9
Source File: FullServantCacheLocalCRDImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
    String operation, Class expectedType )
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    if (!checkForCompatibleServant( cachedInfo, expectedType ))
        return null ;

    // Note that info is shared across multiple threads
    // using the same subcontract, each of which may
    // have its own operation.  Therefore we need to clone it.
    OAInvocationInfo info = new OAInvocationInfo( cachedInfo, operation ) ;
    orb.pushInvocationInfo( info ) ;

    try {
        info.oa().enter() ;
    } catch (OADestroyed pdes) {
        throw wrapper.preinvokePoaDestroyed( pdes ) ;
    }

    return info ;
}
 
Example #10
Source File: MinimalServantCacheLocalCRDImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
    String operation, Class expectedType )
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    if (checkForCompatibleServant( cachedInfo, expectedType ))
        return cachedInfo ;
    else
        return null ;
}
 
Example #11
Source File: CorbaClientDelegateImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
                                       String operation,
                                       Class expectedType)
{
    return
        contactInfoList.getLocalClientRequestDispatcher()
        .servant_preinvoke(self, operation, expectedType);
}
 
Example #12
Source File: CorbaClientDelegateImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
                                       String operation,
                                       Class expectedType)
{
    return
        contactInfoList.getLocalClientRequestDispatcher()
        .servant_preinvoke(self, operation, expectedType);
}
 
Example #13
Source File: NotLocalLocalCRDImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
                                       String operation,
                                       Class expectedType)
{
    // REVISIT: Rewrite rmic.HelloTest and rmic.LocalStubTest
    // (which directly call servant_preinvoke)
    // then revert to exception again.
    return null;
    //throw new INTERNAL();
}
 
Example #14
Source File: NotLocalLocalCRDImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
                                       String operation,
                                       Class expectedType)
{
    // REVISIT: Rewrite rmic.HelloTest and rmic.LocalStubTest
    // (which directly call servant_preinvoke)
    // then revert to exception again.
    return null;
    //throw new INTERNAL();
}
 
Example #15
Source File: CorbaClientDelegateImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
                                       String operation,
                                       Class expectedType)
{
    return
        contactInfoList.getLocalClientRequestDispatcher()
        .servant_preinvoke(self, operation, expectedType);
}
 
Example #16
Source File: FullServantCacheLocalCRDImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void servant_postinvoke(org.omg.CORBA.Object self,
                               ServantObject servantobj)
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    cachedInfo.oa().exit() ;
    orb.popInvocationInfo() ;
}
 
Example #17
Source File: MinimalServantCacheLocalCRDImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
    String operation, Class expectedType )
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    if (checkForCompatibleServant( cachedInfo, expectedType ))
        return cachedInfo ;
    else
        return null ;
}
 
Example #18
Source File: InfoOnlyServantCacheLocalCRDImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
    String operation, Class expectedType )
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    if (!checkForCompatibleServant( cachedInfo, expectedType ))
        return null ;

    // Note that info is shared across multiple threads
    // using the same subcontract, each of which may
    // have its own operation.  Therefore we need to copy it.
    OAInvocationInfo info =  new OAInvocationInfo(cachedInfo, operation) ;
    orb.pushInvocationInfo( info ) ;

    return info ;
}
 
Example #19
Source File: MinimalServantCacheLocalCRDImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
    String operation, Class expectedType )
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    if (checkForCompatibleServant( cachedInfo, expectedType ))
        return cachedInfo ;
    else
        return null ;
}
 
Example #20
Source File: JIDLLocalCRDImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
                                       String operation,
                                       Class expectedType)
{
    if (!checkForCompatibleServant( servant, expectedType ))
        return null ;

    return servant;
}
 
Example #21
Source File: NotLocalLocalCRDImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
                                       String operation,
                                       Class expectedType)
{
    // REVISIT: Rewrite rmic.HelloTest and rmic.LocalStubTest
    // (which directly call servant_preinvoke)
    // then revert to exception again.
    return null;
    //throw new INTERNAL();
}
 
Example #22
Source File: InfoOnlyServantCacheLocalCRDImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
    String operation, Class expectedType )
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    if (!checkForCompatibleServant( cachedInfo, expectedType ))
        return null ;

    // Note that info is shared across multiple threads
    // using the same subcontract, each of which may
    // have its own operation.  Therefore we need to copy it.
    OAInvocationInfo info =  new OAInvocationInfo(cachedInfo, operation) ;
    orb.pushInvocationInfo( info ) ;

    return info ;
}
 
Example #23
Source File: FullServantCacheLocalCRDImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void servant_postinvoke(org.omg.CORBA.Object self,
                               ServantObject servantobj)
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    cachedInfo.oa().exit() ;
    orb.popInvocationInfo() ;
}
 
Example #24
Source File: InfoOnlyServantCacheLocalCRDImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
    String operation, Class expectedType )
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    if (!checkForCompatibleServant( cachedInfo, expectedType ))
        return null ;

    // Note that info is shared across multiple threads
    // using the same subcontract, each of which may
    // have its own operation.  Therefore we need to copy it.
    OAInvocationInfo info =  new OAInvocationInfo(cachedInfo, operation) ;
    orb.pushInvocationInfo( info ) ;

    return info ;
}
 
Example #25
Source File: FullServantCacheLocalCRDImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void servant_postinvoke(org.omg.CORBA.Object self,
                               ServantObject servantobj)
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    cachedInfo.oa().exit() ;
    orb.popInvocationInfo() ;
}
 
Example #26
Source File: MinimalServantCacheLocalCRDImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
    String operation, Class expectedType )
{
    OAInvocationInfo cachedInfo = getCachedInfo() ;
    if (checkForCompatibleServant( cachedInfo, expectedType ))
        return cachedInfo ;
    else
        return null ;
}
 
Example #27
Source File: CorbaClientDelegateImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
                                       String operation,
                                       Class expectedType)
{
    return
        contactInfoList.getLocalClientRequestDispatcher()
        .servant_preinvoke(self, operation, expectedType);
}
 
Example #28
Source File: NotLocalLocalCRDImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
                                       String operation,
                                       Class expectedType)
{
    // REVISIT: Rewrite rmic.HelloTest and rmic.LocalStubTest
    // (which directly call servant_preinvoke)
    // then revert to exception again.
    return null;
    //throw new INTERNAL();
}
 
Example #29
Source File: JIDLLocalCRDImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void setServant( java.lang.Object servant )
{
    if (servant != null && servant instanceof Tie) {
        this.servant = new ServantObject();
        this.servant.servant = ((Tie)servant).getTarget();
    } else {
        this.servant = null;
    }
}
 
Example #30
Source File: JIDLLocalCRDImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
                                       String operation,
                                       Class expectedType)
{
    if (!checkForCompatibleServant( servant, expectedType ))
        return null ;

    return servant;
}