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

The following examples show how to use com.sun.corba.se.spi.protocol.ForwardException. 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 jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/** 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 File: PIHandlerImpl.java    From openjdk-8 with 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 #3
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/** 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 File: PIHandlerImpl.java    From openjdk-8-source with 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
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/** 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 File: PIHandlerImpl.java    From hottub with 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
Source File: CorbaServerRequestDispatcherImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/** 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 File: PIHandlerImpl.java    From openjdk-jdk9 with 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 #9
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/** 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 File: PIHandlerImpl.java    From openjdk-jdk8u-backup with 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
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/** 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
Source File: PIHandlerImpl.java    From openjdk-jdk8u with 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 #13
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/** 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 File: PIHandlerImpl.java    From JDKSourceCode1.8 with 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 #15
Source File: CorbaServerRequestDispatcherImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/** 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 File: PIHandlerImpl.java    From jdk8u60 with 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
Source File: PIHandlerImpl.java    From TencentKona-8 with 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 #18
Source File: CorbaServerRequestDispatcherImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/** 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 #19
Source File: CorbaServerRequestDispatcherImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/** 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 File: PIHandlerImpl.java    From jdk1.8-source-analysis with 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 #21
Source File: POAImpl.java    From TencentKona-8 with 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 #22
Source File: POAImpl.java    From jdk8u60 with 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 #23
Source File: ServantCacheLocalCRDBase.java    From TencentKona-8 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 #24
Source File: ServantCacheLocalCRDBase.java    From openjdk-jdk9 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 #25
Source File: POAImpl.java    From openjdk-jdk9 with 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 #26
Source File: ServantCacheLocalCRDBase.java    From hottub 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 #27
Source File: POAImpl.java    From hottub with 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 #28
Source File: ServantCacheLocalCRDBase.java    From openjdk-8-source 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 #29
Source File: POAImpl.java    From openjdk-8-source with 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 #30
Source File: POAImpl.java    From jdk1.8-source-analysis with 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() ;
    }
}