Class RequestInfoImpl
java.lang.Object
org.omg.CORBA.LocalObject
com.sun.corba.ee.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 TypeFieldDescriptionprivate booleanSet to true if all interceptors have had all their points executed.protected ConnectionSources of request information(package private) intWhich points we are currently executing (so we can implement the validity table).(package private) intThe type of ending point call to make to the interceptors See ClientRequestInfoImpl and ServerRequestInfoImpl for a list of appropriate constants.protected ExceptionThe exception to be returned by received_exception and received_exception_id(package private) static final int(package private) static final int(package private) static final intprivate intThe number of interceptors actually invoked for this client request.private ForwardRequestprivate IOR(package private) boolean(package private) intThe type of intermediate point call to make to the interceptors See ServerRequestInfoImpl for a list of appropriate constants.protected 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 ORBThe ORB from which to get PICurrent and other infoprotected shortThe reply status to return in reply_status.(package private) SlotTablePICurrent's SlotTable(package private) intThe type of starting point call to make to the interceptors See ClientRequestInfoImpl and ServerRequestInfoImpl for a list of appropriate constants.(package private) static final OMGSystemException(package private) static final shortConstant for an uninitialized reply status.protected static final InterceptorsSystemException -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_orb()Throws anorg.omg.CORBA.NO_IMPLEMENTexception with the message "This is a locally constrained object." This method is the default implementation of theorg.omg.CORBA.Objectmethod.protected voidaddServiceContext(Map<Integer, ServiceContext> 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 exceptions 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).(package private) ExceptionReturns the exception to be returned by received_exception and received_exception_id.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(Map<Integer, ServiceContext> 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).private voidinsertApplicationException(ApplicationException appException, Any result) Inserts the UserException inside the given ApplicationException into the given Any.private voidinsertUserException(UserException userException, Any result) Inserts the UserException into the given Any.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.(package private) voidreset()Reset the info object so that it can be reused for a retry, for example.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 interceptors' 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_status(package private) voidsetSlotTable(SlotTable slotTable) The server side does an explicit set rather than taking the current PICurrent table as is done in the general RequestInfoImpl constructor.protected 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, _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
-
wrapper
-
stdWrapper
-
myORB
The ORB from which to get PICurrent and other info -
flowStackIndex
private int flowStackIndexThe number of interceptors actually invoked for this client request. See setFlowStackIndex for a detailed description. -
startingPointCall
int startingPointCallThe type of starting point call to make to the interceptors See ClientRequestInfoImpl and ServerRequestInfoImpl for a list of appropriate constants. -
intermediatePointCall
int intermediatePointCallThe type of intermediate point call to make to the interceptors See ServerRequestInfoImpl for a list of appropriate constants. This does not currently apply to client request interceptors but is here in case intermediate points are introduced in the future. -
endingPointCall
int endingPointCallThe type of ending point call to make to the interceptors See ClientRequestInfoImpl and ServerRequestInfoImpl for a list of appropriate constants. -
replyStatus
protected short replyStatusThe reply status to return in reply_status. This is initialized to UNINITIALIZED so that we can tell if this has been set or not. -
UNINITIALIZED
static final short UNINITIALIZEDConstant for an uninitialized reply status.- See Also:
-
currentExecutionPoint
int currentExecutionPointWhich points we are currently executing (so we can implement the validity table). -
EXECUTION_POINT_STARTING
static final int EXECUTION_POINT_STARTING- See Also:
-
EXECUTION_POINT_INTERMEDIATE
static final int EXECUTION_POINT_INTERMEDIATE- See Also:
-
EXECUTION_POINT_ENDING
static final int EXECUTION_POINT_ENDING- See Also:
-
alreadyExecuted
private boolean alreadyExecutedSet to true if all interceptors have had all their points executed. -
connection
Sources of request information -
forwardRequest
-
forwardRequestIOR
-
slotTable
SlotTable slotTablePICurrent's SlotTable -
exception
The exception to be returned by received_exception and received_exception_id -
interceptorsEnabledForThisRequest
boolean interceptorsEnabledForThisRequest -
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.- Parameters:
myORB- ORB to use
-
-
Method Details
-
_orb
Description copied from class:LocalObjectThrows anorg.omg.CORBA.NO_IMPLEMENTexception with the message "This is a locally constrained object." This method is the default implementation of theorg.omg.CORBA.Objectmethod.- Overrides:
_orbin classLocalObject- Returns:
- the ORB instance that created the Delegate contained in this
ObjectImpl - See Also:
-
reset
void reset()Reset the info object so that it can be reused for a retry, for example. -
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- Returns:
- unique request identifier
-
operation
Implementation for operation() differs for client and server implementations.- Specified by:
operationin interfaceRequestInfoOperations- Returns:
- The name of the operation being invoked.
-
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- Returns:
- array of arguments
- See Also:
-
exceptions
This method returns the list of exceptions 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- Returns:
- array of raised exceptions
- 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- Returns:
- array of contexts
- 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- Returns:
- array of operation contexts
- 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- Returns:
- the result from the invoked operation
- 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- Returns:
- if a response is expected
-
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:- Specified by:
sync_scopein interfaceRequestInfoOperations- Returns:
- how far the request shall progress
- 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:- Specified by:
reply_statusin interfaceRequestInfoOperations- Returns:
- result status
- 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- Returns:
- object to which attribute is forwarded.
-
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- ID of the slot to get data from- Returns:
- Data held in the given slot
- Throws:
InvalidSlot- If the id is not for 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 entry for that ID, BAD_PARAM with a minor code of TBD_BP is raised.- Specified by:
get_request_service_contextin interfaceRequestInfoOperations- Parameters:
id- ID of the service context- Returns:
- A copy of the service context
-
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- ID of the service context- Returns:
- A copy of the Service Context
-
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.
-
insertApplicationException
private void insertApplicationException(ApplicationException appException, Any result) throws UNKNOWN Inserts the UserException inside the given ApplicationException into the given Any. Throws an UNKNOWN with minor code OMGSYstemException.UNKNOWN_USER_EXCEPTION if the Helper class could not be found to insert it with. -
insertUserException
Inserts the UserException into the given Any. Throws an UNKNOWN with minor code OMGSYstemException.UNKNOWN_USER_EXCEPTION if the Helper class could not be found to insert it with. -
nvListToParameterArray
Internal utility method to convert an NVList into a PI Parameter[]- Parameters:
parNVList- list to concert- Returns:
- parameter array
-
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.- Parameters:
exception- Exception to wrap- Returns:
Anywrapping the exception
-
getServiceContext
protected ServiceContext getServiceContext(Map<Integer, ServiceContext> 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.- Parameters:
cachedServiceContexts- cache to search first inserviceContexts- contexts to look up inid- ID to use for look up- Returns:
- found ServiceContext
-
addServiceContext
protected void addServiceContext(Map<Integer, ServiceContext> 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.
- Parameters:
cachedServiceContexts- map to also add the context toserviceContexts- ServiceContexts to add it toservice_context- context to addreplace- if a previous instance should be replaced
-
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.- Parameters:
num- number of interceptors successfully invoked
-
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.- Returns:
- number of interceptors
- See Also:
-
setEndingPointCall
protected void setEndingPointCall(int call) Sets which ending interception point should be called for each interceptor in the virtual flow stack.- Parameters:
call- ending interception point
-
getEndingPointCall
protected int getEndingPointCall()Retrieves the current ending point call type (see setEndingPointCall for more details).- Returns:
- ending point call type
- See Also:
-
setIntermediatePointCall
protected void setIntermediatePointCall(int call) Sets which intermediate interception point should be called for each interceptor in the virtual flow stack.- Parameters:
call- intermediate interception point
-
getIntermediatePointCall
protected int getIntermediatePointCall()Retrieves the current intermediate point call type (see setEndingPointCall for more details).- Returns:
- current intermediate point
- See Also:
-
setStartingPointCall
protected void setStartingPointCall(int call) Sets which starting interception point should be called for each interceptor in the virtual flow stack.- Parameters:
call- which point should called
-
getStartingPointCall
protected int getStartingPointCall()Retrieves the current starting point call type (see setStartingPointCall for more details).- Returns:
- the current stating point
- See Also:
-
getAlreadyExecuted
protected boolean getAlreadyExecuted()Returns true if all interceptors' starting and ending points have already executed to completion, or false if not yet.- Returns:
- if all interceptors have been executed to completion
-
setAlreadyExecuted
protected void setAlreadyExecuted(boolean alreadyExecuted) Sets whether all interceptors' starting and ending points have already been executed to completion.- Parameters:
alreadyExecuted- if all interceptors have been executed
-
setReplyStatus
protected void setReplyStatus(short replyStatus) Sets the value to be returned by reply_status- Parameters:
replyStatus- The value of the reply status
-
getReplyStatus
protected short getReplyStatus()Gets the current reply_status without doing an access check (available only to package and subclasses)- Returns:
- Current reply status
-
setForwardRequest
Stores the given ForwardRequest object for later analysis. This version supplements setForwardRequest( IOR );- Parameters:
forwardRequest- ForwardRequest to store- See Also:
-
setForwardRequest
Stores the given IOR for later forward request analysis. This version supplements setForwardRequest( ForwardRequest );- Parameters:
ior- IOR to store- See Also:
-
getForwardRequestException
Retrieves the ForwardRequest object as a ForwardRequest exception.- Returns:
- the ForwardRequest object
-
getForwardRequestIOR
Retrieves the IOR of the ForwardRequest exception.- Returns:
- The IOR of the exception
-
setException
Sets the exception to be returned by received_exception and received_exception_id.- Parameters:
exception- exception to be returned
-
getException
Exception getException()Returns 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.- Parameters:
executionPoint- Current execution point
-
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
-
setSlotTable
The server side does an explicit set rather than taking the current PICurrent table as is done in the general RequestInfoImpl constructor. -
iorToObject
-