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   Author: AdoptOpenJDK   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
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: CorbaServerRequestDispatcherImpl.java    License: 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 #3
Source Project: jdk1.8-source-analysis   Author: raysonfang   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
Source Project: openjdk-8-source   Author: keerath   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 #5
Source Project: openjdk-8   Author: bpupadhyaya   File: CorbaServerRequestDispatcherImpl.java    License: 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 #6
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: CorbaServerRequestDispatcherImpl.java    License: 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 Project: hottub   Author: dsrg-uoft   File: CorbaServerRequestDispatcherImpl.java    License: 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 #8
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: CorbaServerRequestDispatcherImpl.java    License: 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 #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
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: CorbaServerRequestDispatcherImpl.java    License: 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 #11
Source Project: jdk8u60   Author: chenghanpeng   File: CorbaServerRequestDispatcherImpl.java    License: 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 #12
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   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
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: CorbaServerRequestDispatcherImpl.java    License: 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 #14
Source Project: jdk8u60   Author: chenghanpeng   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   Author: AdoptOpenJDK   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   Author: wupeixuan   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
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: ServerRequestInfoImpl.java    License: GNU General Public License v2.0 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 #18
Source Project: openjdk-8   Author: bpupadhyaya   File: CorbaServerRequestDispatcherImpl.java    License: 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 #19
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: CorbaServerRequestDispatcherImpl.java    License: 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 #20
Source Project: openjdk-8-source   Author: keerath   File: POALocalCRDImpl.java    License: 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 #21
Source Project: openjdk-8   Author: bpupadhyaya   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   Author: keerath   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   Author: raysonfang   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   Author: dsrg-uoft   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   Author: wupeixuan   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   Author: raysonfang   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   Author: bpupadhyaya   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
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   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 #30
Source Project: hottub   Author: dsrg-uoft   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;
}