Java Code Examples for com.sun.corba.se.spi.protocol.ForwardException

The following examples show how to use com.sun.corba.se.spi.protocol.ForwardException. 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
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example 2
Source Project: jdk1.8-source-analysis   Source File: PIHandlerImpl.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Handles exceptions for the starting and intermediate points for
 * server request interceptors.  This is common code that has been
 * factored out into this utility method.
 * <p>
 * This method will NOT work for ending points.
 */
private void serverPIHandleExceptions( ServerRequestInfoImpl info )
{
    int endingPointCall = info.getEndingPointCall();
    if(endingPointCall == ServerRequestInfoImpl.CALL_SEND_EXCEPTION) {
        // If a system exception was thrown, throw it to caller:
        throw (SystemException)info.getException();
    }
    else if( (endingPointCall == ServerRequestInfoImpl.CALL_SEND_OTHER) &&
             (info.getForwardRequestException() != null) )
    {
        // If an interceptor throws a forward request, convert it
        // into a ForwardException for easier handling:
        IOR ior = info.getForwardRequestIOR();
        throw new ForwardException( orb, ior );
    }
}
 
Example 3
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example 4
Source Project: TencentKona-8   Source File: PIHandlerImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Handles exceptions for the starting and intermediate points for
 * server request interceptors.  This is common code that has been
 * factored out into this utility method.
 * <p>
 * This method will NOT work for ending points.
 */
private void serverPIHandleExceptions( ServerRequestInfoImpl info )
{
    int endingPointCall = info.getEndingPointCall();
    if(endingPointCall == ServerRequestInfoImpl.CALL_SEND_EXCEPTION) {
        // If a system exception was thrown, throw it to caller:
        throw (SystemException)info.getException();
    }
    else if( (endingPointCall == ServerRequestInfoImpl.CALL_SEND_OTHER) &&
             (info.getForwardRequestException() != null) )
    {
        // If an interceptor throws a forward request, convert it
        // into a ForwardException for easier handling:
        IOR ior = info.getForwardRequestIOR();
        throw new ForwardException( orb, ior );
    }
}
 
Example 5
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example 6
Source Project: jdk8u60   Source File: PIHandlerImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Handles exceptions for the starting and intermediate points for
 * server request interceptors.  This is common code that has been
 * factored out into this utility method.
 * <p>
 * This method will NOT work for ending points.
 */
private void serverPIHandleExceptions( ServerRequestInfoImpl info )
{
    int endingPointCall = info.getEndingPointCall();
    if(endingPointCall == ServerRequestInfoImpl.CALL_SEND_EXCEPTION) {
        // If a system exception was thrown, throw it to caller:
        throw (SystemException)info.getException();
    }
    else if( (endingPointCall == ServerRequestInfoImpl.CALL_SEND_OTHER) &&
             (info.getForwardRequestException() != null) )
    {
        // If an interceptor throws a forward request, convert it
        // into a ForwardException for easier handling:
        IOR ior = info.getForwardRequestIOR();
        throw new ForwardException( orb, ior );
    }
}
 
Example 7
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example 8
Source Project: JDKSourceCode1.8   Source File: PIHandlerImpl.java    License: MIT License 6 votes vote down vote up
/**
 * Handles exceptions for the starting and intermediate points for
 * server request interceptors.  This is common code that has been
 * factored out into this utility method.
 * <p>
 * This method will NOT work for ending points.
 */
private void serverPIHandleExceptions( ServerRequestInfoImpl info )
{
    int endingPointCall = info.getEndingPointCall();
    if(endingPointCall == ServerRequestInfoImpl.CALL_SEND_EXCEPTION) {
        // If a system exception was thrown, throw it to caller:
        throw (SystemException)info.getException();
    }
    else if( (endingPointCall == ServerRequestInfoImpl.CALL_SEND_OTHER) &&
             (info.getForwardRequestException() != null) )
    {
        // If an interceptor throws a forward request, convert it
        // into a ForwardException for easier handling:
        IOR ior = info.getForwardRequestIOR();
        throw new ForwardException( orb, ior );
    }
}
 
Example 9
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example 10
Source Project: openjdk-jdk8u   Source File: PIHandlerImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Handles exceptions for the starting and intermediate points for
 * server request interceptors.  This is common code that has been
 * factored out into this utility method.
 * <p>
 * This method will NOT work for ending points.
 */
private void serverPIHandleExceptions( ServerRequestInfoImpl info )
{
    int endingPointCall = info.getEndingPointCall();
    if(endingPointCall == ServerRequestInfoImpl.CALL_SEND_EXCEPTION) {
        // If a system exception was thrown, throw it to caller:
        throw (SystemException)info.getException();
    }
    else if( (endingPointCall == ServerRequestInfoImpl.CALL_SEND_OTHER) &&
             (info.getForwardRequestException() != null) )
    {
        // If an interceptor throws a forward request, convert it
        // into a ForwardException for easier handling:
        IOR ior = info.getForwardRequestIOR();
        throw new ForwardException( orb, ior );
    }
}
 
Example 11
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example 12
/**
 * Handles exceptions for the starting and intermediate points for
 * server request interceptors.  This is common code that has been
 * factored out into this utility method.
 * <p>
 * This method will NOT work for ending points.
 */
private void serverPIHandleExceptions( ServerRequestInfoImpl info )
{
    int endingPointCall = info.getEndingPointCall();
    if(endingPointCall == ServerRequestInfoImpl.CALL_SEND_EXCEPTION) {
        // If a system exception was thrown, throw it to caller:
        throw (SystemException)info.getException();
    }
    else if( (endingPointCall == ServerRequestInfoImpl.CALL_SEND_OTHER) &&
             (info.getForwardRequestException() != null) )
    {
        // If an interceptor throws a forward request, convert it
        // into a ForwardException for easier handling:
        IOR ior = info.getForwardRequestIOR();
        throw new ForwardException( orb, ior );
    }
}
 
Example 13
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example 14
Source Project: openjdk-jdk9   Source File: PIHandlerImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Handles exceptions for the starting and intermediate points for
 * server request interceptors.  This is common code that has been
 * factored out into this utility method.
 * <p>
 * This method will NOT work for ending points.
 */
private void serverPIHandleExceptions( ServerRequestInfoImpl info )
{
    int endingPointCall = info.getEndingPointCall();
    if(endingPointCall == ServerRequestInfoImpl.CALL_SEND_EXCEPTION) {
        // If a system exception was thrown, throw it to caller:
        throw (SystemException)info.getException();
    }
    else if( (endingPointCall == ServerRequestInfoImpl.CALL_SEND_OTHER) &&
             (info.getForwardRequestException() != null) )
    {
        // If an interceptor throws a forward request, convert it
        // into a ForwardException for easier handling:
        IOR ior = info.getForwardRequestIOR();
        throw new ForwardException( orb, ior );
    }
}
 
Example 15
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example 16
Source Project: hottub   Source File: PIHandlerImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Handles exceptions for the starting and intermediate points for
 * server request interceptors.  This is common code that has been
 * factored out into this utility method.
 * <p>
 * This method will NOT work for ending points.
 */
private void serverPIHandleExceptions( ServerRequestInfoImpl info )
{
    int endingPointCall = info.getEndingPointCall();
    if(endingPointCall == ServerRequestInfoImpl.CALL_SEND_EXCEPTION) {
        // If a system exception was thrown, throw it to caller:
        throw (SystemException)info.getException();
    }
    else if( (endingPointCall == ServerRequestInfoImpl.CALL_SEND_OTHER) &&
             (info.getForwardRequestException() != null) )
    {
        // If an interceptor throws a forward request, convert it
        // into a ForwardException for easier handling:
        IOR ior = info.getForwardRequestIOR();
        throw new ForwardException( orb, ior );
    }
}
 
Example 17
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example 18
/**
 * Handles exceptions for the starting and intermediate points for
 * server request interceptors.  This is common code that has been
 * factored out into this utility method.
 * <p>
 * This method will NOT work for ending points.
 */
private void serverPIHandleExceptions( ServerRequestInfoImpl info )
{
    int endingPointCall = info.getEndingPointCall();
    if(endingPointCall == ServerRequestInfoImpl.CALL_SEND_EXCEPTION) {
        // If a system exception was thrown, throw it to caller:
        throw (SystemException)info.getException();
    }
    else if( (endingPointCall == ServerRequestInfoImpl.CALL_SEND_OTHER) &&
             (info.getForwardRequestException() != null) )
    {
        // If an interceptor throws a forward request, convert it
        // into a ForwardException for easier handling:
        IOR ior = info.getForwardRequestIOR();
        throw new ForwardException( orb, ior );
    }
}
 
Example 19
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example 20
Source Project: openjdk-8   Source File: PIHandlerImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Handles exceptions for the starting and intermediate points for
 * server request interceptors.  This is common code that has been
 * factored out into this utility method.
 * <p>
 * This method will NOT work for ending points.
 */
private void serverPIHandleExceptions( ServerRequestInfoImpl info )
{
    int endingPointCall = info.getEndingPointCall();
    if(endingPointCall == ServerRequestInfoImpl.CALL_SEND_EXCEPTION) {
        // If a system exception was thrown, throw it to caller:
        throw (SystemException)info.getException();
    }
    else if( (endingPointCall == ServerRequestInfoImpl.CALL_SEND_OTHER) &&
             (info.getForwardRequestException() != null) )
    {
        // If an interceptor throws a forward request, convert it
        // into a ForwardException for easier handling:
        IOR ior = info.getForwardRequestIOR();
        throw new ForwardException( orb, ior );
    }
}
 
Example 21
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 22
Source Project: jdk1.8-source-analysis   Source File: POAImpl.java    License: Apache License 2.0 5 votes vote down vote up
public void getInvocationServant( OAInvocationInfo info )
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling getInvocationServant on poa " + this ) ;
        }

        java.lang.Object servant = null ;

        try {
            servant = mediator.getInvocationServant( info.id(),
                info.getOperation() );
        } catch (ForwardRequest freq) {
            throw new ForwardException( getORB(), freq.forward_reference ) ;
        }

        info.setServant( servant ) ;
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting getInvocationServant on poa " + this ) ;
        }

        unlock() ;
    }
}
 
Example 23
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 24
Source Project: TencentKona-8   Source File: POAImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void getInvocationServant( OAInvocationInfo info )
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling getInvocationServant on poa " + this ) ;
        }

        java.lang.Object servant = null ;

        try {
            servant = mediator.getInvocationServant( info.id(),
                info.getOperation() );
        } catch (ForwardRequest freq) {
            throw new ForwardException( getORB(), freq.forward_reference ) ;
        }

        info.setServant( servant ) ;
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting getInvocationServant on poa " + this ) ;
        }

        unlock() ;
    }
}
 
Example 25
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 26
Source Project: jdk8u60   Source File: POAImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void getInvocationServant( OAInvocationInfo info )
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling getInvocationServant on poa " + this ) ;
        }

        java.lang.Object servant = null ;

        try {
            servant = mediator.getInvocationServant( info.id(),
                info.getOperation() );
        } catch (ForwardRequest freq) {
            throw new ForwardException( getORB(), freq.forward_reference ) ;
        }

        info.setServant( servant ) ;
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting getInvocationServant on poa " + this ) ;
        }

        unlock() ;
    }
}
 
Example 27
Source Project: JDKSourceCode1.8   Source File: ServantCacheLocalCRDBase.java    License: MIT License 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 28
Source Project: JDKSourceCode1.8   Source File: POAImpl.java    License: MIT License 5 votes vote down vote up
public void getInvocationServant( OAInvocationInfo info )
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling getInvocationServant on poa " + this ) ;
        }

        java.lang.Object servant = null ;

        try {
            servant = mediator.getInvocationServant( info.id(),
                info.getOperation() );
        } catch (ForwardRequest freq) {
            throw new ForwardException( getORB(), freq.forward_reference ) ;
        }

        info.setServant( servant ) ;
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting getInvocationServant on poa " + this ) ;
        }

        unlock() ;
    }
}
 
Example 29
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 30
Source Project: openjdk-jdk8u   Source File: POAImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void getInvocationServant( OAInvocationInfo info )
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling getInvocationServant on poa " + this ) ;
        }

        java.lang.Object servant = null ;

        try {
            servant = mediator.getInvocationServant( info.id(),
                info.getOperation() );
        } catch (ForwardRequest freq) {
            throw new ForwardException( getORB(), freq.forward_reference ) ;
        }

        info.setServant( servant ) ;
    } finally {
        if (debug) {
            ORBUtility.dprint( this,
                "Exiting getInvocationServant on poa " + this ) ;
        }

        unlock() ;
    }
}