com.sun.corba.se.spi.oa.ObjectAdapter Java Examples

The following examples show how to use com.sun.corba.se.spi.oa.ObjectAdapter. 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: CorbaServerRequestDispatcherImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
private java.lang.Object getServant(ObjectAdapter objectAdapter, byte[] objectId,
    String operation)
    throws OADestroyed
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".getServant->");
        }

        OAInvocationInfo info = objectAdapter.makeInvocationInfo(objectId);
        info.setOperation(operation);
        orb.pushInvocationInfo(info);
        objectAdapter.getInvocationServant(info);
        return info.getServantContainer() ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".getServant<-");
        }
    }
}
 
Example #2
Source File: SpecialMethod.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public CorbaMessageMediator invoke(java.lang.Object servant,
                                   CorbaMessageMediator request,
                                   byte[] objectId,
                                   ObjectAdapter objectAdapter)
{
    ORB orb = (ORB)request.getBroker() ;
    ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.OA_INVOCATION ) ;

    if ((servant == null) || (servant instanceof NullServant)) {
        return request.getProtocolHandler().createSystemExceptionResponse(
            request, wrapper.badSkeleton(), null);
    } else {
        return request.getProtocolHandler().createSystemExceptionResponse(
            request, wrapper.getinterfaceNotImplemented(), null);
    }
}
 
Example #3
Source File: PIHandlerImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void initializeServerPIInfo( CorbaMessageMediator request,
    ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp )
{
    if( !hasServerInterceptors ) return;

    RequestInfoStack infoStack =
        (RequestInfoStack)threadLocalServerRequestInfoStack.get();
    ServerRequestInfoImpl info = new ServerRequestInfoImpl( orb );
    infoStack.push( info );
    printPush();

    // Notify request object that once response is constructed, make
    // sure we execute ending points.
    request.setExecutePIInResponseConstructor( true );

    info.setInfo( request, oa, objectId, oktemp );
}
 
Example #4
Source File: SpecialMethod.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public CorbaMessageMediator invoke(java.lang.Object servant,
                                   CorbaMessageMediator request,
                                   byte[] objectId,
                                   ObjectAdapter objectAdapter)
{
    ORB orb = (ORB)request.getBroker() ;
    ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.OA_INVOCATION ) ;

    if ((servant == null) || (servant instanceof NullServant)) {
        return request.getProtocolHandler().createSystemExceptionResponse(
            request, wrapper.badSkeleton(), null);
    } else {
        return request.getProtocolHandler().createSystemExceptionResponse(
            request, wrapper.getinterfaceNotImplemented(), null);
    }
}
 
Example #5
Source File: CorbaServerRequestDispatcherImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void releaseServant(ObjectAdapter objectAdapter)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".releaseServant->");
        }

        if (objectAdapter == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".releaseServant: null object adapter");
            }
            return ;
        }

        try {
            objectAdapter.returnServant();
        } finally {
            objectAdapter.exit();
            orb.popInvocationInfo() ;
        }
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".releaseServant<-");
        }
    }
}
 
Example #6
Source File: CorbaServerRequestDispatcherImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void releaseServant(ObjectAdapter objectAdapter)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".releaseServant->");
        }

        if (objectAdapter == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".releaseServant: null object adapter");
            }
            return ;
        }

        try {
            objectAdapter.returnServant();
        } finally {
            objectAdapter.exit();
            orb.popInvocationInfo() ;
        }
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".releaseServant<-");
        }
    }
}
 
Example #7
Source File: PIHandlerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void initializeServerPIInfo( CorbaMessageMediator request,
    ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp )
{
    if( !hasServerInterceptors ) return;

    RequestInfoStack infoStack =
        (RequestInfoStack)threadLocalServerRequestInfoStack.get();
    ServerRequestInfoImpl info = new ServerRequestInfoImpl( orb );
    infoStack.push( info );
    printPush();

    // Notify request object that once response is constructed, make
    // sure we execute ending points.
    request.setExecutePIInResponseConstructor( true );

    info.setInfo( request, oa, objectId, oktemp );
}
 
Example #8
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void releaseServant(ObjectAdapter objectAdapter)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".releaseServant->");
        }

        if (objectAdapter == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".releaseServant: null object adapter");
            }
            return ;
        }

        try {
            objectAdapter.returnServant();
        } finally {
            objectAdapter.exit();
            orb.popInvocationInfo() ;
        }
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".releaseServant<-");
        }
    }
}
 
Example #9
Source File: PIHandlerImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void initializeServerPIInfo( CorbaMessageMediator request,
    ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp )
{
    if( !hasServerInterceptors ) return;

    RequestInfoStack infoStack =
        (RequestInfoStack)threadLocalServerRequestInfoStack.get();
    ServerRequestInfoImpl info = new ServerRequestInfoImpl( orb );
    infoStack.push( info );
    printPush();

    // Notify request object that once response is constructed, make
    // sure we execute ending points.
    request.setExecutePIInResponseConstructor( true );

    info.setInfo( request, oa, objectId, oktemp );
}
 
Example #10
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private java.lang.Object getServant(ObjectAdapter objectAdapter, byte[] objectId,
    String operation)
    throws OADestroyed
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".getServant->");
        }

        OAInvocationInfo info = objectAdapter.makeInvocationInfo(objectId);
        info.setOperation(operation);
        orb.pushInvocationInfo(info);
        objectAdapter.getInvocationServant(info);
        return info.getServantContainer() ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".getServant<-");
        }
    }
}
 
Example #11
Source File: CorbaServerRequestDispatcherImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
private java.lang.Object getServant(ObjectAdapter objectAdapter, byte[] objectId,
    String operation)
    throws OADestroyed
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".getServant->");
        }

        OAInvocationInfo info = objectAdapter.makeInvocationInfo(objectId);
        info.setOperation(operation);
        orb.pushInvocationInfo(info);
        objectAdapter.getInvocationServant(info);
        return info.getServantContainer() ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".getServant<-");
        }
    }
}
 
Example #12
Source File: CorbaServerRequestDispatcherImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
private void releaseServant(ObjectAdapter objectAdapter)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".releaseServant->");
        }

        if (objectAdapter == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".releaseServant: null object adapter");
            }
            return ;
        }

        try {
            objectAdapter.returnServant();
        } finally {
            objectAdapter.exit();
            orb.popInvocationInfo() ;
        }
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".releaseServant<-");
        }
    }
}
 
Example #13
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private java.lang.Object getServant(ObjectAdapter objectAdapter, byte[] objectId,
    String operation)
    throws OADestroyed
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".getServant->");
        }

        OAInvocationInfo info = objectAdapter.makeInvocationInfo(objectId);
        info.setOperation(operation);
        orb.pushInvocationInfo(info);
        objectAdapter.getInvocationServant(info);
        return info.getServantContainer() ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".getServant<-");
        }
    }
}
 
Example #14
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private java.lang.Object getServant(ObjectAdapter objectAdapter, byte[] objectId,
    String operation)
    throws OADestroyed
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".getServant->");
        }

        OAInvocationInfo info = objectAdapter.makeInvocationInfo(objectId);
        info.setOperation(operation);
        orb.pushInvocationInfo(info);
        objectAdapter.getInvocationServant(info);
        return info.getServantContainer() ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".getServant<-");
        }
    }
}
 
Example #15
Source File: PIHandlerImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void objectAdapterCreated( ObjectAdapter oa )
{
    if (!hasIORInterceptors)
        return ;

    interceptorInvoker.objectAdapterCreated( oa ) ;
}
 
Example #16
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private ObjectAdapter findObjectAdapter(ObjectKeyTemplate oktemp)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".findObjectAdapter->");
        }

        RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
        int scid = oktemp.getSubcontractId() ;
        ObjectAdapterFactory oaf = scr.getObjectAdapterFactory(scid);
        if (oaf == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".findObjectAdapter: failed to find ObjectAdapterFactory");
            }

            throw wrapper.noObjectAdapterFactory() ;
        }

        ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
        ObjectAdapter oa = oaf.find(oaid);

        if (oa == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".findObjectAdapter: failed to find ObjectAdaptor");
            }

            throw wrapper.badAdapterId() ;
        }

        return oa ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".findObjectAdapter<-");
        }
    }
}
 
Example #17
Source File: SpecialMethod.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public CorbaMessageMediator invoke(java.lang.Object servant,
                                   CorbaMessageMediator request,
                                   byte[] objectId,
                                   ObjectAdapter objectAdapter)
{
    boolean result = (servant == null) || (servant instanceof NullServant) ;
    CorbaMessageMediator response =
        request.getProtocolHandler().createResponse(request, null);
    ((OutputStream)response.getOutputObject()).write_boolean(result);
    return response;
}
 
Example #18
Source File: IORInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new IORInfo implementation.  This info object will establish
 * tagged components with the template for the provided IOR Template.
 */
IORInfoImpl( ObjectAdapter adapter ) {
    this.orb = adapter.getORB() ;

    orbutilWrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    wrapper = InterceptorsSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    omgWrapper = OMGSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;

    this.adapter = adapter;
}
 
Example #19
Source File: PIHandlerImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void objectAdapterCreated( ObjectAdapter oa )
{
    if (!hasIORInterceptors)
        return ;

    interceptorInvoker.objectAdapterCreated( oa ) ;
}
 
Example #20
Source File: PIHandlerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void objectAdapterCreated( ObjectAdapter oa )
{
    if (!hasIORInterceptors)
        return ;

    interceptorInvoker.objectAdapterCreated( oa ) ;
}
 
Example #21
Source File: SpecialMethod.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public CorbaMessageMediator invoke(java.lang.Object servant,
                                   CorbaMessageMediator request,
                                   byte[] objectId,
                                   ObjectAdapter objectAdapter)
{
    boolean result = (servant == null) || (servant instanceof NullServant) ;
    CorbaMessageMediator response =
        request.getProtocolHandler().createResponse(request, null);
    ((OutputStream)response.getOutputObject()).write_boolean(result);
    return response;
}
 
Example #22
Source File: ServantCacheLocalCRDBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected synchronized OAInvocationInfo getCachedInfo()
{
    if (!servantIsLocal)
        throw wrapper.servantMustBeLocal() ;

    if (cachedInfo == null) {
        ObjectAdapter oa = oaf.find( oaid ) ;
        cachedInfo = oa.makeInvocationInfo( objectId ) ;

        // InvocationInfo must be pushed before calling getInvocationServant
        orb.pushInvocationInfo( cachedInfo ) ;

        try {
            oa.enter( );
            oa.getInvocationServant( cachedInfo ) ;
        } catch (ForwardException freq) {
            throw wrapper.illegalForwardRequest( freq ) ;
        } catch( OADestroyed oades ) {
            // This is an error since no user of this implementation
            // should ever throw this exception
            throw wrapper.adapterDestroyed( oades ) ;
        } finally {
            oa.returnServant( );
            oa.exit( );
            orb.popInvocationInfo() ;
        }
    }

    return cachedInfo ;
}
 
Example #23
Source File: IIOPProfileImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Return the servant for this IOR, if it is local AND if the OA that
 * implements this objref supports direct access to servants outside of an
 * invocation.
 * XXX revisit: do we want this at all?  If we do, it might move to the
 * ObjectKeyTemplate instead.
 */
public java.lang.Object getServant()
{
    if (!isLocal())
        return null ;

    RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
    ObjectAdapterFactory oaf = scr.getObjectAdapterFactory(
        oktemp.getSubcontractId() ) ;

    ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
    ObjectAdapter oa = null ;

    try {
        oa = oaf.find( oaid ) ;
    } catch (SystemException exc) {
        // Could not find the OA, so just return null.
        // This usually happens when POAs are being deleted,
        // and the POA always return null for getLocalServant anyway.
        wrapper.getLocalServantFailure( exc, oaid.toString() ) ;
        return null ;
    }

    byte[] boid = oid.getId() ;
    java.lang.Object servant = oa.getLocalServant( boid ) ;
    return servant ;
}
 
Example #24
Source File: POALocalCRDImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private OAInvocationInfo servantEnter( ObjectAdapter oa ) throws OADestroyed
{
    oa.enter() ;

    OAInvocationInfo info = oa.makeInvocationInfo( objectId ) ;
    orb.pushInvocationInfo( info ) ;

    return info ;
}
 
Example #25
Source File: TOAFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public ObjectAdapter find ( ObjectAdapterId oaid )
{
    if (oaid.equals( ObjectKeyTemplateBase.JIDL_OAID )  )
        // Return the dispatch-only TOA, which can dispatch
        // request for objects created by any TOA.
        return getTOA() ;
    else
        throw wrapper.badToaOaid() ;
}
 
Example #26
Source File: ServerRequestInfoImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Stores the various sources of information used for this info object.
 */
protected void setInfo( CorbaMessageMediator request, ObjectAdapter oa,
    byte[] objectId, ObjectKeyTemplate oktemp )
{
    this.request = request;
    this.objectId = objectId;
    this.oktemp = oktemp;
    this.objectAdapter = oa ;
    this.connection = (com.sun.corba.se.spi.legacy.connection.Connection)
        request.getConnection();
}
 
Example #27
Source File: PIHandlerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void objectAdapterCreated( ObjectAdapter oa )
{
    if (!hasIORInterceptors)
        return ;

    interceptorInvoker.objectAdapterCreated( oa ) ;
}
 
Example #28
Source File: PIHandlerImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void objectAdapterCreated( ObjectAdapter oa )
{
    if (!hasIORInterceptors)
        return ;

    interceptorInvoker.objectAdapterCreated( oa ) ;
}
 
Example #29
Source File: IORInfoImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new IORInfo implementation.  This info object will establish
 * tagged components with the template for the provided IOR Template.
 */
IORInfoImpl( ObjectAdapter adapter ) {
    this.orb = adapter.getORB() ;

    orbutilWrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    wrapper = InterceptorsSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    omgWrapper = OMGSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;

    this.adapter = adapter;
}
 
Example #30
Source File: SpecialMethod.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public CorbaMessageMediator invoke(java.lang.Object servant,
                                   CorbaMessageMediator request,
                                   byte[] objectId,
                                   ObjectAdapter objectAdapter)
{
    if ((servant == null) || (servant instanceof NullServant)) {
        ORB orb = (ORB)request.getBroker() ;
        ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
            CORBALogDomains.OA_INVOCATION ) ;

        return request.getProtocolHandler().createSystemExceptionResponse(
            request, wrapper.badSkeleton(), null);
    }

    String[] ids = objectAdapter.getInterfaces( servant, objectId );
    String clientId =
        ((InputStream)request.getInputObject()).read_string();
    boolean answer = false;
    for(int i = 0; i < ids.length; i++)
        if (ids[i].equals(clientId)) {
            answer = true;
            break;
        }

    CorbaMessageMediator response =
        request.getProtocolHandler().createResponse(request, null);
    ((OutputStream)response.getOutputObject()).write_boolean(answer);
    return response;
}