Java Code Examples for org.omg.CORBA.portable.ServantObject

The following examples show how to use org.omg.CORBA.portable.ServantObject. These examples are extracted from open source projects. 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 Project: jdk1.8-source-analysis   Author: raysonfang   File: FullServantCacheLocalCRDImpl.java    License: 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 #2
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: LocalClientRequestDispatcherBase.java    License: 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 Project: TencentKona-8   Author: Tencent   File: FullServantCacheLocalCRDImpl.java    License: 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 #4
Source Project: TencentKona-8   Author: Tencent   File: LocalClientRequestDispatcherBase.java    License: 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 #5
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: LocalClientRequestDispatcherBase.java    License: 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 #6
Source Project: jdk8u60   Author: chenghanpeng   File: FullServantCacheLocalCRDImpl.java    License: 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 Project: JDKSourceCode1.8   Author: wupeixuan   File: FullServantCacheLocalCRDImpl.java    License: 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 #8
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: LocalClientRequestDispatcherBase.java    License: 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 Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: FullServantCacheLocalCRDImpl.java    License: 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 Project: jdk1.8-source-analysis   Author: raysonfang   File: JIDLLocalCRDImpl.java    License: Apache License 2.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 #11
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: JIDLLocalCRDImpl.java    License: Apache License 2.0 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 #12
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: NotLocalLocalCRDImpl.java    License: 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 #13
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: FullServantCacheLocalCRDImpl.java    License: Apache License 2.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 #14
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: InfoOnlyServantCacheLocalCRDImpl.java    License: 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 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 #15
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: MinimalServantCacheLocalCRDImpl.java    License: 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 #16
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: CorbaClientDelegateImpl.java    License: 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 #17
Source Project: TencentKona-8   Author: Tencent   File: JIDLLocalCRDImpl.java    License: 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 #18
Source Project: TencentKona-8   Author: Tencent   File: JIDLLocalCRDImpl.java    License: GNU General Public License v2.0 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 #19
Source Project: TencentKona-8   Author: Tencent   File: NotLocalLocalCRDImpl.java    License: 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 #20
Source Project: TencentKona-8   Author: Tencent   File: FullServantCacheLocalCRDImpl.java    License: 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 #21
Source Project: TencentKona-8   Author: Tencent   File: InfoOnlyServantCacheLocalCRDImpl.java    License: 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 #22
Source Project: TencentKona-8   Author: Tencent   File: MinimalServantCacheLocalCRDImpl.java    License: 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 #23
Source Project: TencentKona-8   Author: Tencent   File: CorbaClientDelegateImpl.java    License: 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 #24
Source Project: jdk8u60   Author: chenghanpeng   File: JIDLLocalCRDImpl.java    License: 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 #25
Source Project: jdk8u60   Author: chenghanpeng   File: NotLocalLocalCRDImpl.java    License: 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 #26
Source Project: jdk8u60   Author: chenghanpeng   File: FullServantCacheLocalCRDImpl.java    License: 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 #27
Source Project: jdk8u60   Author: chenghanpeng   File: InfoOnlyServantCacheLocalCRDImpl.java    License: 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 #28
Source Project: jdk8u60   Author: chenghanpeng   File: MinimalServantCacheLocalCRDImpl.java    License: 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 #29
Source Project: jdk8u60   Author: chenghanpeng   File: CorbaClientDelegateImpl.java    License: 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 #30
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: JIDLLocalCRDImpl.java    License: 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;
}