Class RequestInfoImpl

java.lang.Object
org.omg.CORBA.LocalObject
com.sun.corba.se.impl.interceptors.RequestInfoImpl
All Implemented Interfaces:
RequestInfoExt, Serializable, Object, IDLEntity, RequestInfo, RequestInfoOperations
Direct Known Subclasses:
ClientRequestInfoImpl, ServerRequestInfoImpl

public abstract class RequestInfoImpl extends LocalObject implements RequestInfo, RequestInfoExt
Implementation of the RequestInfo interface as specified in orbos/99-12-02 section 5.4.1.
See Also:
  • Field Details

    • myORB

      protected ORB myORB
    • wrapper

      protected InterceptorsSystemException wrapper
    • stdWrapper

      protected OMGSystemException stdWrapper
    • flowStackIndex

      protected int flowStackIndex
    • startingPointCall

      protected int startingPointCall
    • intermediatePointCall

      protected int intermediatePointCall
    • endingPointCall

      protected int endingPointCall
    • replyStatus

      protected short replyStatus
    • UNINITIALIZED

      protected static final short UNINITIALIZED
      See Also:
    • currentExecutionPoint

      protected int currentExecutionPoint
    • EXECUTION_POINT_STARTING

      protected static final int EXECUTION_POINT_STARTING
      See Also:
    • EXECUTION_POINT_INTERMEDIATE

      protected static final int EXECUTION_POINT_INTERMEDIATE
      See Also:
    • EXECUTION_POINT_ENDING

      protected static final int EXECUTION_POINT_ENDING
      See Also:
    • alreadyExecuted

      protected boolean alreadyExecuted
    • connection

      protected Connection connection
    • serviceContexts

      protected ServiceContexts serviceContexts
    • forwardRequest

      protected ForwardRequest forwardRequest
    • forwardRequestIOR

      protected IOR forwardRequestIOR
    • slotTable

      protected SlotTable slotTable
    • exception

      protected Exception exception
    • MID_REQUEST_ID

      protected static final int MID_REQUEST_ID
      See Also:
    • MID_OPERATION

      protected static final int MID_OPERATION
      See Also:
    • MID_ARGUMENTS

      protected static final int MID_ARGUMENTS
      See Also:
    • MID_EXCEPTIONS

      protected static final int MID_EXCEPTIONS
      See Also:
    • MID_CONTEXTS

      protected static final int MID_CONTEXTS
      See Also:
    • MID_OPERATION_CONTEXT

      protected static final int MID_OPERATION_CONTEXT
      See Also:
    • MID_RESULT

      protected static final int MID_RESULT
      See Also:
    • MID_RESPONSE_EXPECTED

      protected static final int MID_RESPONSE_EXPECTED
      See Also:
    • MID_SYNC_SCOPE

      protected static final int MID_SYNC_SCOPE
      See Also:
    • MID_REPLY_STATUS

      protected static final int MID_REPLY_STATUS
      See Also:
    • MID_FORWARD_REFERENCE

      protected static final int MID_FORWARD_REFERENCE
      See Also:
    • MID_GET_SLOT

      protected static final int MID_GET_SLOT
      See Also:
    • MID_GET_REQUEST_SERVICE_CONTEXT

      protected static final int MID_GET_REQUEST_SERVICE_CONTEXT
      See Also:
    • MID_GET_REPLY_SERVICE_CONTEXT

      protected static final int MID_GET_REPLY_SERVICE_CONTEXT
      See Also:
    • MID_RI_LAST

      protected static final int MID_RI_LAST
      See Also:
  • Constructor Details

    • RequestInfoImpl

      public RequestInfoImpl(ORB myORB)
      Creates a new RequestInfoImpl object.
  • Method Details

    • request_id

      public abstract int request_id()
      Implementation for request_id() differs for client and server implementations. Uniquely identifies an active request/reply sequence. Once a request/reply sequence is concluded this ID may be reused. (this is NOT necessarily the same as the GIOP request_id).
      Specified by:
      request_id in interface RequestInfoOperations
    • operation

      public abstract String operation()
      Implementation for operation() differs for client and server implementations. The name of the operation being invoked.
      Specified by:
      operation in interface RequestInfoOperations
    • arguments

      public abstract Parameter[] arguments()
      This method returns the list of arguments for the operation that was invoked. It raises NO_RESOURCES exception if the operation is not invoked by using DII mechanism.
      Specified by:
      arguments in interface RequestInfoOperations
      See Also:
    • exceptions

      public abstract TypeCode[] exceptions()
      This method returns the list of exceptios that was raised when the operation was invoked. It raises NO_RESOURCES exception if the operation is not invoked by using DII mechanism.
      Specified by:
      exceptions in interface RequestInfoOperations
      See Also:
    • contexts

      public abstract String[] contexts()
      This method returns the list of contexts for the DII operation. It raises NO_RESOURCES exception if the operation is not invoked by using DII mechanism.
      Specified by:
      contexts in interface RequestInfoOperations
      See Also:
    • operation_context

      public abstract String[] operation_context()
      This method returns the list of operation_context for the DII operation. It raises NO_RESOURCES exception if the operation is not invoked by using DII mechanism.
      Specified by:
      operation_context in interface RequestInfoOperations
      See Also:
    • result

      public abstract Any result()
      This method returns the result from the invoked DII operation. It raises NO_RESOURCES exception if the operation is not invoked by using DII mechanism.
      Specified by:
      result in interface RequestInfoOperations
      See Also:
    • response_expected

      public abstract boolean response_expected()
      Implementation for response_expected() differs for client and server implementations. Indicates whether a response is expected. On the client, a reply is not returned when response_expected is false, so receive_reply cannot be called. receive_other is called unless an exception occurs, in which case receive_exception is called. On the client, within send_poll, this attribute is true.
      Specified by:
      response_expected in interface RequestInfoOperations
    • sync_scope

      public short sync_scope()
      Defined in the Messaging specification. Pertinent only when response_expected is false. If response_expected is true, the value of sync_scope is undefined. It defines how far the request shall progress before control is returned to the client. This attribute may have one of the follwing values:
      • Messaging::SYNC_NONE
      • Messaging::SYNC_WITH_TRANSPORT
      • Messaging::SYNC_WITH_SERVER
      • Messaging::SYNC_WITH_TARGET
      Specified by:
      sync_scope in interface RequestInfoOperations
      See Also:
    • reply_status

      public short reply_status()
      Describes the state of the result of the operation invocation. Its value can be one of the following:
      • PortableInterceptor::SUCCESSFUL
      • PortableInterceptor::SYSTEM_EXCEPTION
      • PortableInterceptor::USER_EXCEPTION
      • PortableInterceptor::LOCATION_FORWARD
      • PortableInterceptor::TRANSPORT_RETRY
      Specified by:
      reply_status in interface RequestInfoOperations
      See Also:
    • forward_reference

      public abstract Object forward_reference()
      Implementation for forward_reference() differs for client and server implementations. If the reply_status attribute is LOCATION_FORWARD then this attribute will contain the object to which the request will be forwarded. It is indeterminate whether a forwarded request will actually occur.
      Specified by:
      forward_reference in interface RequestInfoOperations
    • get_slot

      public Any get_slot(int id) throws InvalidSlot
      Returns the data from the given slot of the PortableInterceptor::Current that is in the scope of the request.

      If the given slot has not been set, then an any containing a type code with a TCKind value of tk_null is returned.

      If the ID does not define an allocated slot, InvalidSlot is raised.

      Specified by:
      get_slot in interface RequestInfoOperations
      Parameters:
      id - The SlotId of the slot which is to be returned.
      Returns:
      The slot data, in the form of an any, obtained with the given identifier.
      Throws:
      InvalidSlot - thrown if the ID does not define an allocated slot.
      See Also:
    • get_request_service_context

      public abstract ServiceContext get_request_service_context(int id)
      Implementation for get_request_service_context() differs for client and server implementations. This operation returns a copy of the service context with the given ID that is associated with the request. If the request's service context does not contain an etry for that ID, BAD_PARAM with a minor code of TBD_BP is raised.
      Specified by:
      get_request_service_context in interface RequestInfoOperations
      Parameters:
      id - The IOP.ServiceId of the service context which is to be returned.
      Returns:
      The IOP.ServiceContext obtained with the given identifier.
    • get_reply_service_context

      public abstract ServiceContext get_reply_service_context(int id)
      Implementation for get_reply_service_context() differs for client and server implementations. This operation returns a copy of the service context with the given ID that is associated with the reply. IF the request's service context does not contain an entry for that ID, BAD_PARAM with a minor code of TBD_BP is raised.
      Specified by:
      get_reply_service_context in interface RequestInfoOperations
      Parameters:
      id - The IOP.ServiceId of the service context which is to be returned.
      Returns:
      The IOP.ServiceContext obtained with the given identifier.
    • connection

      public Connection connection()
      Specified by:
      connection in interface RequestInfoExt
      Returns:
      The connection on which the request is made. Note: we store the connection as an internal type but expose it here as an external type.
    • nvListToParameterArray

      protected Parameter[] nvListToParameterArray(NVList parNVList)
      Internal utility method to convert an NVList into a PI Parameter[]
    • exceptionToAny

      protected Any exceptionToAny(Exception exception)
      Utility to wrap the given Exception in an Any object and return it. If the exception is a UserException which cannot be inserted into an any, then this returns an Any containing the system exception UNKNOWN.
    • getServiceContext

      protected ServiceContext getServiceContext(HashMap cachedServiceContexts, ServiceContexts serviceContexts, int id)
      Utility method to look up a service context with the given id and convert it to an IOP.ServiceContext. Uses the given HashMap as a cache. If not found in cache, the result is inserted in the cache.
    • addServiceContext

      protected void addServiceContext(HashMap cachedServiceContexts, ServiceContexts serviceContexts, ServiceContext service_context, boolean replace)
      Utility method to add an IOP.ServiceContext to a core.ServiceContexts object. If replace is true, any service context with the given id is replaced.

      Raises BAD_INV_ORDER if replace is false and a service context with the given id already exists.

      Uses the given HashMap as a cache. If a service context is placed in the container, it goes in the HashMap as well.

    • setFlowStackIndex

      protected void setFlowStackIndex(int num)
      Sets the number of interceptors whose starting interception points were successfully invoked on this client call. As specified in orbos/99-12-02, section 5.2.1., not all interceptors will be invoked if a ForwardRequest exception or a system exception is raised. This keeps track of how many were successfully executed so we know not to execute the corresponding ending interception points for the interceptors whose starting interception points were not completed. This simulates the "Flow Stack Visual Model" presented in section 5.1.3.
    • getFlowStackIndex

      protected int getFlowStackIndex()
      Returns the number of interceptors whose starting interception points were actually invoked on this client request. See setFlowStackIndex for more details.
    • setEndingPointCall

      protected void setEndingPointCall(int call)
      Sets which ending interception point should be called for each interceptor in the virtual flow stack.
    • getEndingPointCall

      protected int getEndingPointCall()
      Retrieves the current ending point call type (see setEndingPointCall for more details).
    • setIntermediatePointCall

      protected void setIntermediatePointCall(int call)
      Sets which intermediate interception point should be called for each interceptor in the virtual flow stack.
    • getIntermediatePointCall

      protected int getIntermediatePointCall()
      Retrieves the current intermediate point call type (see setEndingPointCall for more details).
    • setStartingPointCall

      protected void setStartingPointCall(int call)
      Sets which starting interception point should be called for each interceptor in the virtual flow stack.
    • getStartingPointCall

      protected int getStartingPointCall()
      Retrieves the current starting point call type (see setStartingPointCall for more details).
    • getAlreadyExecuted

      protected boolean getAlreadyExecuted()
      Returns true if all interceptors' starting and ending points have already executed to completion, or false if not yet.
    • setAlreadyExecuted

      protected void setAlreadyExecuted(boolean alreadyExecuted)
      Sets whether all interceotrs' starting and ending points have already been executed to completion.
    • setReplyStatus

      protected void setReplyStatus(short replyStatus)
      Sets the value to be returned by reply_status
    • getReplyStatus

      protected short getReplyStatus()
      Gets the current reply_status without doing an access check (available only to package and subclasses)
    • setForwardRequest

      protected void setForwardRequest(ForwardRequest forwardRequest)
      Stores the given ForwardRequest object for later analysis. This version supplements setForwardRequest( IOR );
    • setForwardRequest

      protected void setForwardRequest(IOR ior)
      Stores the given IOR for later forward request analysis. This version supplements setForwardRequest( ForwardRequest );
    • getForwardRequestException

      protected ForwardRequest getForwardRequestException()
      Retrieves the ForwardRequest object as a ForwardRequest exception.
    • getForwardRequestIOR

      protected IOR getForwardRequestIOR()
      Retrieves the IOR of the ForwardRequest exception.
    • setException

      protected void setException(Exception exception)
      Sets the exception to be returned by received_exception and received_exception_id.
    • setCurrentExecutionPoint

      protected void setCurrentExecutionPoint(int executionPoint)
      Sets the execution point that we are currently executing (starting points, intermediate points, or ending points). This allows us to enforce the validity table.
    • checkAccess

      protected abstract void checkAccess(int methodID) throws BAD_INV_ORDER
      Check whether the caller is allowed to access this method at this particular time. This is overridden in subclasses to implement the validity table specified in ptc/00-04-05, table 21-1 and 21-2. The currentExecutionPoint attribute is checked, and if access is forbidden at this time, BAD_INV_ORDER is raised with a minor code of TBD_BIO.
      Parameters:
      methodID - The ID of this method, one of the MID_* constants. This allows us to easily look up the method access in a table. Note that method ids may overlap between subclasses.
      Throws:
      BAD_INV_ORDER
    • iorToObject

      protected Object iorToObject(IOR ior)