Class ServerRequestInfoImpl
- java.lang.Object
-
- org.omg.CORBA.LocalObject
-
- com.sun.corba.ee.impl.interceptors.RequestInfoImpl
-
- com.sun.corba.ee.impl.interceptors.ServerRequestInfoImpl
-
- All Implemented Interfaces:
RequestInfoExt
,ServerRequestInfoExt
,java.io.Serializable
,Object
,IDLEntity
,RequestInfo
,RequestInfoOperations
,ServerRequestInfo
,ServerRequestInfoOperations
public final class ServerRequestInfoImpl extends RequestInfoImpl implements ServerRequestInfo, ServerRequestInfoExt
Implementation of the ServerRequestInfo interface as specified in orbos/99-12-02 section 5.4.3.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ServerRequestInfoImpl.AddReplyServiceContextCommand
-
Field Summary
Fields Modifier and Type Field Description private byte[]
adapterId
private java.lang.String[]
adapterName
private java.util.ArrayList<ServerRequestInfoImpl.AddReplyServiceContextCommand>
addReplyServiceContextQueue
private Parameter[]
cachedArguments
private java.util.HashMap<java.lang.Integer,ServiceContext>
cachedReplyServiceContexts
private java.util.HashMap<java.lang.Integer,ServiceContext>
cachedRequestServiceContexts
private Any
cachedSendingException
(package private) static int
CALL_INTERMEDIATE_NONE
(package private) static int
CALL_RECEIVE_REQUEST
(package private) static int
CALL_RECEIVE_REQUEST_SERVICE_CONTEXT
(package private) static int
CALL_SEND_EXCEPTION
(package private) static int
CALL_SEND_OTHER
(package private) static int
CALL_SEND_REPLY
private NVList
dsiArguments
private Any
dsiException
private Any
dsiResult
private boolean
forwardRequestRaisedInEnding
private boolean
isDynamic
private static int
MID_ADAPTER_ID
private static int
MID_ADAPTER_NAME
private static int
MID_ADD_REPLY_SERVICE_CONTEXT
private static int
MID_GET_SERVER_POLICY
private static int
MID_OBJECT_ID
private static int
MID_ORB_ID
private static int
MID_SENDING_EXCEPTION
private static int
MID_SERVER_ID
private static int
MID_SET_SLOT
private static int
MID_TARGET_IS_A
private static int
MID_TARGET_MOST_DERIVED_INTERFACE
private ObjectAdapter
objectAdapter
private byte[]
objectId
private ObjectKeyTemplate
oktemp
private ReplyMessage
replyMessage
private MessageMediator
request
private java.lang.Object
servant
private int
serverRequestId
private java.lang.String
targetMostDerivedInterface
private static boolean[][]
validCall
-
Fields inherited from class com.sun.corba.ee.impl.interceptors.RequestInfoImpl
connection, currentExecutionPoint, endingPointCall, exception, EXECUTION_POINT_ENDING, EXECUTION_POINT_INTERMEDIATE, EXECUTION_POINT_STARTING, interceptorsEnabledForThisRequest, intermediatePointCall, MID_ARGUMENTS, MID_CONTEXTS, MID_EXCEPTIONS, MID_FORWARD_REFERENCE, MID_GET_REPLY_SERVICE_CONTEXT, MID_GET_REQUEST_SERVICE_CONTEXT, MID_GET_SLOT, MID_OPERATION, MID_OPERATION_CONTEXT, MID_REPLY_STATUS, MID_REQUEST_ID, MID_RESPONSE_EXPECTED, MID_RESULT, MID_RI_LAST, MID_SYNC_SCOPE, myORB, replyStatus, slotTable, startingPointCall, stdWrapper, UNINITIALIZED, wrapper
-
-
Constructor Summary
Constructors Constructor Description ServerRequestInfoImpl(ORB myORB)
Creates a new ServerRequestInfo implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
adapter_id()
The opaque identifier for the object adapter.java.lang.String[]
adapter_name()
Returns the sequence of strings that identifies the object adapter instance that is handling this request.void
add_reply_service_context(ServiceContext service_context, boolean replace)
Allows Interceptors to add service contexts to the request.Parameter[]
arguments()
See ServerRequestInfo for javadocs.protected void
checkAccess(int methodID)
See description for RequestInfoImpl.checkAccessprivate void
checkForNullTemplate()
java.lang.String[]
contexts()
See ServerRequestInfo for javadocs.private void
enqueue(ServerRequestInfoImpl.AddReplyServiceContextCommand addReply)
TypeCode[]
exceptions()
See ServerRequestInfo for javadocs.Object
forward_reference()
See ServerRequestInfo for javadocs.ServiceContext
get_reply_service_context(int id)
See ServerRequestInfo for javadocs.ServiceContext
get_request_service_context(int id)
See ServerRequestInfo for javadocs.Policy
get_server_policy(int type)
Returns the policy in effect for this operation for the given policy type.(package private) boolean
isDynamic()
Returns true if this is a dynamic invocation, or false if not(package private) boolean
isForwardRequestRaisedInEnding()
Returns true if ForwardRequest was raised by a server ending point or false otherwise.boolean
isNameService()
byte[]
object_id()
The opaque object_id describing the target of the operation invocation.java.lang.String
operation()
See ServerRequestInfo for javadocs.java.lang.String[]
operation_context()
See ServerRequestInfo for javadocs.java.lang.String
orb_id()
Returns the ID that was used to create the ORB.(package private) void
releaseServant()
Release the servant object so the user has control over its lifetime.int
request_id()
See ServerRequestInfo for javadocs.(package private) void
reset()
Reset the info object so that it can be reused for a retry, for example.boolean
response_expected()
See ServerRequestInfo for javadocs.Any
result()
See ServerRequestInfo for javadocs.Any
sending_exception()
Any containing the exception to be returned to the client.java.lang.String
server_id()
Returns the server ID that was specified on ORB::init using the -ORBServerId argument.void
set_slot(int id, Any data)
Allows an Interceptor to set a slot in the Current that is in the scope of the request.protected void
setCurrentExecutionPoint(int executionPoint)
Overridden from RequestInfoImpl.protected void
setDSIArguments(NVList arguments)
Stores the various sources of information used for this info object.protected void
setDSIException(Any exception)
Stores the various sources of information used for this info object.protected void
setDSIResult(Any result)
Stores the various sources of information used for this info object.protected void
setException(java.lang.Exception exception)
Sets the exception to be returned by received_exception and received_exception_id.(package private) void
setForwardRequestRaisedInEnding()
Sets the forwardRequestRaisedInEnding flag to true, indicating that a server ending point has raised location forward at some point.protected void
setInfo(MessageMediator request, ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp)
Stores the various sources of information used for this info object.protected void
setInfo(java.lang.Object servant, java.lang.String targetMostDerivedInterface)
Stores the various sources of information used for this info object.(package private) void
setReplyMessage(ReplyMessage replyMessage)
Set reply messageprotected void
setReplyStatus(short replyStatus)
Overridden from RequestInfoImpl.boolean
target_is_a(java.lang.String id)
Returns true if the servant is the given RepositoryId, false if it is not.java.lang.String
target_most_derived_interface()
The RepositoryID for the most derived interface of the servant.java.lang.String
toString()
-
Methods inherited from class com.sun.corba.ee.impl.interceptors.RequestInfoImpl
_orb, addServiceContext, connection, exceptionToAny, get_slot, getAlreadyExecuted, getEndingPointCall, getException, getFlowStackIndex, getForwardRequestException, getForwardRequestIOR, getIntermediatePointCall, getReplyStatus, getServiceContext, getStartingPointCall, iorToObject, nvListToParameterArray, reply_status, setAlreadyExecuted, setEndingPointCall, setFlowStackIndex, setForwardRequest, setForwardRequest, setIntermediatePointCall, setSlotTable, setStartingPointCall, sync_scope
-
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_connection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods 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
-
Methods inherited from interface org.omg.PortableInterceptor.RequestInfoOperations
get_slot, reply_status, sync_scope
-
-
-
-
Field Detail
-
CALL_RECEIVE_REQUEST_SERVICE_CONTEXT
static final int CALL_RECEIVE_REQUEST_SERVICE_CONTEXT
- See Also:
- Constant Field Values
-
CALL_RECEIVE_REQUEST
static final int CALL_RECEIVE_REQUEST
- See Also:
- Constant Field Values
-
CALL_INTERMEDIATE_NONE
static final int CALL_INTERMEDIATE_NONE
- See Also:
- Constant Field Values
-
CALL_SEND_REPLY
static final int CALL_SEND_REPLY
- See Also:
- Constant Field Values
-
CALL_SEND_EXCEPTION
static final int CALL_SEND_EXCEPTION
- See Also:
- Constant Field Values
-
CALL_SEND_OTHER
static final int CALL_SEND_OTHER
- See Also:
- Constant Field Values
-
forwardRequestRaisedInEnding
private boolean forwardRequestRaisedInEnding
-
request
private MessageMediator request
-
servant
private java.lang.Object servant
-
objectId
private byte[] objectId
-
oktemp
private ObjectKeyTemplate oktemp
-
adapterId
private byte[] adapterId
-
adapterName
private java.lang.String[] adapterName
-
addReplyServiceContextQueue
private java.util.ArrayList<ServerRequestInfoImpl.AddReplyServiceContextCommand> addReplyServiceContextQueue
-
replyMessage
private ReplyMessage replyMessage
-
targetMostDerivedInterface
private java.lang.String targetMostDerivedInterface
-
dsiArguments
private NVList dsiArguments
-
dsiResult
private Any dsiResult
-
dsiException
private Any dsiException
-
isDynamic
private boolean isDynamic
-
objectAdapter
private ObjectAdapter objectAdapter
-
serverRequestId
private int serverRequestId
-
cachedArguments
private Parameter[] cachedArguments
-
cachedSendingException
private Any cachedSendingException
-
cachedRequestServiceContexts
private java.util.HashMap<java.lang.Integer,ServiceContext> cachedRequestServiceContexts
-
cachedReplyServiceContexts
private java.util.HashMap<java.lang.Integer,ServiceContext> cachedReplyServiceContexts
-
MID_SENDING_EXCEPTION
private static final int MID_SENDING_EXCEPTION
- See Also:
- Constant Field Values
-
MID_OBJECT_ID
private static final int MID_OBJECT_ID
- See Also:
- Constant Field Values
-
MID_ADAPTER_ID
private static final int MID_ADAPTER_ID
- See Also:
- Constant Field Values
-
MID_TARGET_MOST_DERIVED_INTERFACE
private static final int MID_TARGET_MOST_DERIVED_INTERFACE
- See Also:
- Constant Field Values
-
MID_GET_SERVER_POLICY
private static final int MID_GET_SERVER_POLICY
- See Also:
- Constant Field Values
-
MID_SET_SLOT
private static final int MID_SET_SLOT
- See Also:
- Constant Field Values
-
MID_TARGET_IS_A
private static final int MID_TARGET_IS_A
- See Also:
- Constant Field Values
-
MID_ADD_REPLY_SERVICE_CONTEXT
private static final int MID_ADD_REPLY_SERVICE_CONTEXT
- See Also:
- Constant Field Values
-
MID_SERVER_ID
private static final int MID_SERVER_ID
- See Also:
- Constant Field Values
-
MID_ORB_ID
private static final int MID_ORB_ID
- See Also:
- Constant Field Values
-
MID_ADAPTER_NAME
private static final int MID_ADAPTER_NAME
- See Also:
- Constant Field Values
-
validCall
private static final boolean[][] validCall
-
-
Constructor Detail
-
ServerRequestInfoImpl
ServerRequestInfoImpl(ORB myORB)
Creates a new ServerRequestInfo implementation. The constructor is package scope since no other package need create an instance of this class.
-
-
Method Detail
-
reset
void reset()
Reset the info object so that it can be reused for a retry, for example.- Overrides:
reset
in classRequestInfoImpl
-
sending_exception
public Any sending_exception()
Any containing the exception to be returned to the client.- Specified by:
sending_exception
in interfaceServerRequestInfoOperations
- Returns:
- Any containing an Exception
- See Also:
-
PortableInterceptor
package comments for limitations / unimplemented features
-
object_id
public byte[] object_id()
The opaque object_id describing the target of the operation invocation.- Specified by:
object_id
in interfaceServerRequestInfoOperations
- Returns:
- the object ID
-
checkForNullTemplate
private void checkForNullTemplate()
-
server_id
public java.lang.String server_id()
Description copied from interface:ServerRequestInfoOperations
Returns the server ID that was specified on ORB::init using the -ORBServerId argument.- Specified by:
server_id
in interfaceServerRequestInfoOperations
- Returns:
- the server ID
-
orb_id
public java.lang.String orb_id()
Description copied from interface:ServerRequestInfoOperations
Returns the ID that was used to create the ORB.- Specified by:
orb_id
in interfaceServerRequestInfoOperations
- Returns:
- the ORB ID
-
adapter_name
public java.lang.String[] adapter_name()
Description copied from interface:ServerRequestInfoOperations
Returns the sequence of strings that identifies the object adapter instance that is handling this request.- Specified by:
adapter_name
in interfaceServerRequestInfoOperations
- Returns:
- the sequence of strings
-
adapter_id
public byte[] adapter_id()
The opaque identifier for the object adapter.- Specified by:
adapter_id
in interfaceServerRequestInfoOperations
- Returns:
- the adapter ID
-
target_most_derived_interface
public java.lang.String target_most_derived_interface()
The RepositoryID for the most derived interface of the servant.- Specified by:
target_most_derived_interface
in interfaceServerRequestInfoOperations
- Returns:
- the repository ID
-
get_server_policy
public Policy get_server_policy(int type)
Returns the policy in effect for this operation for the given policy type.- Specified by:
get_server_policy
in interfaceServerRequestInfoOperations
- Parameters:
type
- TheCORBA.PolicyType
which specifies the policy to be returned.- Returns:
- The
CORBA.Policy
obtained with the given policy type. - See Also:
ORBInitInfoOperations.register_policy_factory(int, org.omg.PortableInterceptor.PolicyFactory)
-
set_slot
public void set_slot(int id, Any data) throws InvalidSlot
Allows an Interceptor to set a slot in the Current that is in the scope of the request. If data already exists in that slot, it will be overwritten. If the ID does not define an allocated slot, InvalidSlot is raised.- Specified by:
set_slot
in interfaceServerRequestInfoOperations
- Parameters:
id
- The id of the slot.data
- The data, in the form of an any, to store in that slot.- Throws:
InvalidSlot
- thrown if the ID does not define an allocated slot.- See Also:
Current
-
target_is_a
public boolean target_is_a(java.lang.String id)
Returns true if the servant is the given RepositoryId, false if it is not.- Specified by:
target_is_a
in interfaceServerRequestInfoOperations
- Parameters:
id
- The caller wants to know if the servant is this repository id.- Returns:
- Is the servant the given RepositoryId?
-
add_reply_service_context
public void add_reply_service_context(ServiceContext service_context, boolean replace)
Allows Interceptors to add service contexts to the request.- Specified by:
add_reply_service_context
in interfaceServerRequestInfoOperations
- Parameters:
service_context
- TheIOP.ServiceContext
to add to the reply.replace
- Indicates the behavior of this operation when a service context already exists with the given ID. If false, thenBAD_INV_ORDER
with a standard minor code of 15 is thrown. If true, then the existing service context is replaced by the new one.
-
request_id
public int request_id()
See ServerRequestInfo for javadocs.- Specified by:
request_id
in interfaceRequestInfoOperations
- Specified by:
request_id
in classRequestInfoImpl
- Returns:
- unique request identifier
-
operation
public java.lang.String operation()
See ServerRequestInfo for javadocs.- Specified by:
operation
in interfaceRequestInfoOperations
- Specified by:
operation
in classRequestInfoImpl
- Returns:
- The name of the operation being invoked.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
arguments
public Parameter[] arguments()
See ServerRequestInfo for javadocs.- Specified by:
arguments
in interfaceRequestInfoOperations
- Specified by:
arguments
in classRequestInfoImpl
- Returns:
- array of arguments
- See Also:
-
PortableInterceptor
package comments for limitations / unimplemented features
-
exceptions
public TypeCode[] exceptions()
See ServerRequestInfo for javadocs.- Specified by:
exceptions
in interfaceRequestInfoOperations
- Specified by:
exceptions
in classRequestInfoImpl
- Returns:
- array of raised exceptions
- See Also:
-
PortableInterceptor
package comments for limitations / unimplemented features
-
contexts
public java.lang.String[] contexts()
See ServerRequestInfo for javadocs.- Specified by:
contexts
in interfaceRequestInfoOperations
- Specified by:
contexts
in classRequestInfoImpl
- Returns:
- array of contexts
- See Also:
-
PortableInterceptor
package comments for limitations / unimplemented features
-
operation_context
public java.lang.String[] operation_context()
See ServerRequestInfo for javadocs.- Specified by:
operation_context
in interfaceRequestInfoOperations
- Specified by:
operation_context
in classRequestInfoImpl
- Returns:
- array of operation contexts
- See Also:
-
PortableInterceptor
package comments for limitations / unimplemented features
-
result
public Any result()
See ServerRequestInfo for javadocs.- Specified by:
result
in interfaceRequestInfoOperations
- Specified by:
result
in classRequestInfoImpl
- Returns:
- the result from the invoked operation
- See Also:
-
PortableInterceptor
package comments for limitations / unimplemented features
-
response_expected
public boolean response_expected()
See ServerRequestInfo for javadocs.- Specified by:
response_expected
in interfaceRequestInfoOperations
- Specified by:
response_expected
in classRequestInfoImpl
- Returns:
- if a response is expected
-
forward_reference
public Object forward_reference()
See ServerRequestInfo for javadocs.- Specified by:
forward_reference
in interfaceRequestInfoOperations
- Specified by:
forward_reference
in classRequestInfoImpl
- Returns:
- object to which attribute is forwarded.
-
get_request_service_context
public ServiceContext get_request_service_context(int id)
See ServerRequestInfo for javadocs.- Specified by:
get_request_service_context
in interfaceRequestInfoOperations
- Specified by:
get_request_service_context
in classRequestInfoImpl
- Parameters:
id
- ID of the service context- Returns:
- A copy of the service context
-
get_reply_service_context
public ServiceContext get_reply_service_context(int id)
See ServerRequestInfo for javadocs.- Specified by:
get_reply_service_context
in interfaceRequestInfoOperations
- Specified by:
get_reply_service_context
in classRequestInfoImpl
- Parameters:
id
- ID of the service context- Returns:
- A copy of the Service Context
-
isNameService
public boolean isNameService()
- Specified by:
isNameService
in interfaceServerRequestInfoExt
-
enqueue
private void enqueue(ServerRequestInfoImpl.AddReplyServiceContextCommand addReply)
-
setCurrentExecutionPoint
protected void setCurrentExecutionPoint(int executionPoint)
Overridden from RequestInfoImpl. This version calls the super and then, if we are changing to ending points, executes all enqueued AddReplyServiceContextCommands.- Overrides:
setCurrentExecutionPoint
in classRequestInfoImpl
- Parameters:
executionPoint
- Current execution point
-
setInfo
protected void setInfo(MessageMediator request, ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp)
Stores the various sources of information used for this info object.- Parameters:
request
- Request holder, included the Connectionoa
- Object AdapterobjectId
- id of objectoktemp
- template for object
-
setDSIArguments
protected void setDSIArguments(NVList arguments)
Stores the various sources of information used for this info object.- Parameters:
arguments
- Arguments for the operation
-
setDSIException
protected void setDSIException(Any exception)
Stores the various sources of information used for this info object.- Parameters:
exception
-Any
holding exception that occurred during operation
-
setDSIResult
protected void setDSIResult(Any result)
Stores the various sources of information used for this info object.- Parameters:
result
-Any
holding result of operation
-
setException
protected void setException(java.lang.Exception exception)
Description copied from class:RequestInfoImpl
Sets the exception to be returned by received_exception and received_exception_id.- Overrides:
setException
in classRequestInfoImpl
- Parameters:
exception
- exception to be returned
-
setInfo
protected void setInfo(java.lang.Object servant, java.lang.String targetMostDerivedInterface)
Stores the various sources of information used for this info object.- Parameters:
servant
- Servant usedtargetMostDerivedInterface
- derived interface
-
setReplyMessage
void setReplyMessage(ReplyMessage replyMessage)
Set reply message
-
setReplyStatus
protected void setReplyStatus(short replyStatus)
Overridden from RequestInfoImpl. Calls the super class, then sets the ending point call depending on the reply status.- Overrides:
setReplyStatus
in classRequestInfoImpl
- Parameters:
replyStatus
- The value of the reply status
-
releaseServant
void releaseServant()
Release the servant object so the user has control over its lifetime. Called after receive_request is finished executing.
-
setForwardRequestRaisedInEnding
void setForwardRequestRaisedInEnding()
Sets the forwardRequestRaisedInEnding flag to true, indicating that a server ending point has raised location forward at some point.
-
isForwardRequestRaisedInEnding
boolean isForwardRequestRaisedInEnding()
Returns true if ForwardRequest was raised by a server ending point or false otherwise.
-
isDynamic
boolean isDynamic()
Returns true if this is a dynamic invocation, or false if not
-
checkAccess
protected void checkAccess(int methodID)
See description for RequestInfoImpl.checkAccess- Specified by:
checkAccess
in classRequestInfoImpl
- 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.
-
-