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
Implementation of the RequestInfo interface as specified in
orbos/99-12-02 section 5.4.1.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Connectionprotected intprotected intprotected Exceptionprotected static final intprotected static final intprotected static final intprotected intprotected ForwardRequestprotected IORprotected intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected ORBprotected shortprotected ServiceContextsprotected SlotTableprotected intprotected OMGSystemExceptionprotected static final shortprotected InterceptorsSystemException -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddServiceContext(HashMap cachedServiceContexts, ServiceContexts serviceContexts, ServiceContext service_context, boolean replace) Utility method to add an IOP.ServiceContext to a core.ServiceContexts object.abstract Parameter[]This method returns the list of arguments for the operation that was invoked.protected abstract voidcheckAccess(int methodID) Check whether the caller is allowed to access this method at this particular time.abstract String[]contexts()This method returns the list of contexts for the DII operation.abstract TypeCode[]This method returns the list of exceptios that was raised when the operation was invoked.protected AnyexceptionToAny(Exception exception) Utility to wrap the given Exception in an Any object and return it.abstract ObjectImplementation for forward_reference() differs for client and server implementations.abstract ServiceContextget_reply_service_context(int id) Implementation for get_reply_service_context() differs for client and server implementations.abstract ServiceContextget_request_service_context(int id) Implementation for get_request_service_context() differs for client and server implementations.get_slot(int id) Returns the data from the given slot of the PortableInterceptor::Current that is in the scope of the request.protected booleanReturns true if all interceptors' starting and ending points have already executed to completion, or false if not yet.protected intRetrieves the current ending point call type (see setEndingPointCall for more details).protected intReturns the number of interceptors whose starting interception points were actually invoked on this client request.protected ForwardRequestRetrieves the ForwardRequest object as a ForwardRequest exception.protected IORRetrieves the IOR of the ForwardRequest exception.protected intRetrieves the current intermediate point call type (see setEndingPointCall for more details).protected shortGets the current reply_status without doing an access check (available only to package and subclasses)protected ServiceContextgetServiceContext(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.protected intRetrieves the current starting point call type (see setStartingPointCall for more details).protected ObjectiorToObject(IOR ior) protected Parameter[]nvListToParameterArray(NVList parNVList) Internal utility method to convert an NVList into a PI Parameter[]abstract StringImplementation for operation() differs for client and server implementations.abstract String[]This method returns the list of operation_context for the DII operation.shortDescribes the state of the result of the operation invocation.abstract intImplementation for request_id() differs for client and server implementations.abstract booleanImplementation for response_expected() differs for client and server implementations.abstract Anyresult()This method returns the result from the invoked DII operation.protected voidsetAlreadyExecuted(boolean alreadyExecuted) Sets whether all interceotrs' starting and ending points have already been executed to completion.protected voidsetCurrentExecutionPoint(int executionPoint) Sets the execution point that we are currently executing (starting points, intermediate points, or ending points).protected voidsetEndingPointCall(int call) Sets which ending interception point should be called for each interceptor in the virtual flow stack.protected voidsetException(Exception exception) Sets the exception to be returned by received_exception and received_exception_id.protected voidsetFlowStackIndex(int num) Sets the number of interceptors whose starting interception points were successfully invoked on this client call.protected voidsetForwardRequest(IOR ior) Stores the given IOR for later forward request analysis.protected voidsetForwardRequest(ForwardRequest forwardRequest) Stores the given ForwardRequest object for later analysis.protected voidsetIntermediatePointCall(int call) Sets which intermediate interception point should be called for each interceptor in the virtual flow stack.protected voidsetReplyStatus(short replyStatus) Sets the value to be returned by reply_statusprotected voidsetStartingPointCall(int call) Sets which starting interception point should be called for each interceptor in the virtual flow stack.shortDefined in the Messaging specification.Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connectionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
-
Field Details
-
myORB
-
wrapper
-
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
-
serviceContexts
-
forwardRequest
-
forwardRequestIOR
-
slotTable
-
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
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_idin interfaceRequestInfoOperations
-
operation
Implementation for operation() differs for client and server implementations. The name of the operation being invoked.- Specified by:
operationin interfaceRequestInfoOperations
-
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:
argumentsin interfaceRequestInfoOperations- See Also:
-
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:
exceptionsin interfaceRequestInfoOperations- See Also:
-
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:
contextsin interfaceRequestInfoOperations- See Also:
-
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_contextin interfaceRequestInfoOperations- See Also:
-
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:
resultin interfaceRequestInfoOperations- 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_expectedin interfaceRequestInfoOperations
-
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_scopein interfaceRequestInfoOperations- 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_statusin interfaceRequestInfoOperations- See Also:
-
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_referencein interfaceRequestInfoOperations
-
get_slot
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_slotin interfaceRequestInfoOperations- Parameters:
id- TheSlotIdof 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
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_contextin interfaceRequestInfoOperations- Parameters:
id- TheIOP.ServiceIdof the service context which is to be returned.- Returns:
- The
IOP.ServiceContextobtained with the given identifier.
-
get_reply_service_context
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_contextin interfaceRequestInfoOperations- Parameters:
id- TheIOP.ServiceIdof the service context which is to be returned.- Returns:
- The
IOP.ServiceContextobtained with the given identifier.
-
connection
- Specified by:
connectionin interfaceRequestInfoExt- 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
Internal utility method to convert an NVList into a PI Parameter[] -
exceptionToAny
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
Stores the given ForwardRequest object for later analysis. This version supplements setForwardRequest( IOR ); -
setForwardRequest
Stores the given IOR for later forward request analysis. This version supplements setForwardRequest( ForwardRequest ); -
getForwardRequestException
Retrieves the ForwardRequest object as a ForwardRequest exception. -
getForwardRequestIOR
Retrieves the IOR of the ForwardRequest exception. -
setException
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
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
-