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

The following examples show how to use com.sun.corba.se.spi.oa.ObjectAdapter. 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: openjdk-jdk9   Source File: PIHandlerImpl.java    License: 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 2
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 3
Source Project: jdk1.8-source-analysis   Source File: PIHandlerImpl.java    License: 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 4
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
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 6
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
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 8
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 9
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 10
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
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 12
Source Project: openjdk-jdk9   Source File: SpecialMethod.java    License: 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 13
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 14
Source Project: jdk8u60   Source File: PIHandlerImpl.java    License: 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 15
Source Project: openjdk-jdk9   Source File: POALocalCRDImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void servantExit( ObjectAdapter oa )
{
    try {
        oa.returnServant();
    } finally {
        oa.exit() ;
        orb.popInvocationInfo() ;
    }
}
 
Example 16
Source Project: JDKSourceCode1.8   Source File: PIHandlerImpl.java    License: MIT License 5 votes vote down vote up
public void objectAdapterCreated( ObjectAdapter oa )
{
    if (!hasIORInterceptors)
        return ;

    interceptorInvoker.objectAdapterCreated( oa ) ;
}
 
Example 17
/**
 * 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 18
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 19
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 20
private OAInvocationInfo servantEnter( ObjectAdapter oa ) throws OADestroyed
{
    oa.enter() ;

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

    return info ;
}
 
Example 21
Source Project: openjdk-8   Source File: SpecialMethod.java    License: 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 Project: openjdk-8-source   Source File: TOAFactory.java    License: 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 23
Source Project: jdk1.8-source-analysis   Source File: POALocalCRDImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void servantExit( ObjectAdapter oa )
{
    try {
        oa.returnServant();
    } finally {
        oa.exit() ;
        orb.popInvocationInfo() ;
    }
}
 
Example 24
Source Project: hottub   Source File: TOAFactory.java    License: 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 25
Source Project: JDKSourceCode1.8   Source File: POALocalCRDImpl.java    License: MIT License 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 26
Source Project: jdk1.8-source-analysis   Source File: TOAFactory.java    License: Apache License 2.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 27
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 28
Source Project: openjdk-8   Source File: TOAFactory.java    License: 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 29
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 30
Source Project: hottub   Source File: SpecialMethod.java    License: 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;
}