Package org.omg.CORBA
Class Request
java.lang.Object
org.omg.CORBA.Request
- Direct Known Subclasses:
RequestImpl
An object containing the information necessary for
invoking a method. This class is
the cornerstone of the ORB Dynamic
Invocation Interface (DII), which allows dynamic creation and
invocation of requests.
A server cannot tell the difference between a client
invocation using a client stub and a request using the DII.
A Request object consists of:
- the name of the operation to be invoked
- an
NVListcontaining arguments for the operation.
Each item in the list is aNamedValueobject, which has three parts:- the name of the argument
- the value of the argument (as an
Anyobject) - the argument mode flag indicating whether the argument is for input, output, or both
Request objects may also contain additional information,
depending on how an operation was defined in the original IDL
interface definition. For example, where appropriate, they may contain
a NamedValue object to hold the return value or exception,
a context, a list of possible exceptions, and a list of
context strings that need to be resolved.
New Request objects are created using one of the
create_request methods in the Object class.
In other words, a create_request method is performed on the
object which is to be invoked.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AnyCreates an input argument and adds it to thisRequestobject.abstract AnyAdds an input/output argument to thisRequestobject.abstract Anyadd_named_in_arg(String name) Creates an input argument with the given name and adds it to thisRequestobject.abstract Anyadd_named_inout_arg(String name) Adds an input/output argument with the given name to thisRequestobject.abstract Anyadd_named_out_arg(String name) Adds an output argument with the given name to thisRequestobject.abstract AnyAdds an output argument to thisRequestobject.abstract NVListRetrieves theNVListobject containing the arguments to the method being invoked.abstract ContextListcontexts()Retrieves theContextListobject for this request.abstract Contextctx()Retrieves theContextobject for this request.abstract voidSets this request'sContextobject to the one given.abstract Environmentenv()Retrieves theEnvironmentobject for this request.abstract ExceptionListRetrieves theExceptionListobject for this request.abstract voidAllows the user to access the response for the invocation triggered earlier with thesend_deferredmethod.abstract voidinvoke()Makes a synchronous invocation using the information in theRequestobject.abstract StringRetrieves the name of the method to be invoked.abstract booleanAllows the user to determine whether a response has been received for the invocation triggered earlier with thesend_deferredmethod.abstract NamedValueresult()Retrieves theNamedValueobject containing the return value for the method.abstract AnyReturns theAnyobject that contains the value for the result of the method.abstract voidMakes an asynchronous invocation on the request.abstract voidMakes a oneway invocation on the request.abstract voidSets the typecode for the return value of the method.abstract Objecttarget()Retrieves the the target object reference.
-
Constructor Details
-
Request
public Request()
-
-
Method Details
-
target
Retrieves the the target object reference.- Returns:
- the object reference that points to the object implementation for the method to be invoked
-
operation
Retrieves the name of the method to be invoked.- Returns:
- the name of the method to be invoked
-
arguments
Retrieves theNVListobject containing the arguments to the method being invoked. The elements in the list areNamedValueobjects, with each one describing an argument to the method.- Returns:
- the
NVListobject containing the arguments for the method
-
result
Retrieves theNamedValueobject containing the return value for the method.- Returns:
- the
NamedValueobject containing the result of the method
-
env
Retrieves theEnvironmentobject for this request. It contains the exception that the method being invoked has thrown (after the invocation returns).- Returns:
- the
Environmentobject for this request
-
exceptions
Retrieves theExceptionListobject for this request. This list containsTypeCodeobjects describing the exceptions that may be thrown by the method being invoked.- Returns:
- the
ExceptionListobject describing the exceptions that may be thrown by the method being invoked
-
contexts
Retrieves theContextListobject for this request. This list contains contextStrings that need to be resolved and sent with the invocation.- Returns:
- the list of context strings whose values need to be resolved and sent with the invocation.
-
ctx
Retrieves theContextobject for this request. This is a list of properties giving information about the client, the environment, or the circumstances of this request.- Returns:
- the
Contextobject that is to be used to resolve any context strings whose values need to be sent with the invocation
-
ctx
Sets this request'sContextobject to the one given.- Parameters:
c- the newContextobject to be used for resolving context strings
-
add_in_arg
Creates an input argument and adds it to thisRequestobject.- Returns:
- an
Anyobject that contains the value and typecode for the input argument added
-
add_named_in_arg
Creates an input argument with the given name and adds it to thisRequestobject.- Parameters:
name- the name of the argument being added- Returns:
- an
Anyobject that contains the value and typecode for the input argument added
-
add_inout_arg
Adds an input/output argument to thisRequestobject.- Returns:
- an
Anyobject that contains the value and typecode for the input/output argument added
-
add_named_inout_arg
Adds an input/output argument with the given name to thisRequestobject.- Parameters:
name- the name of the argument being added- Returns:
- an
Anyobject that contains the value and typecode for the input/output argument added
-
add_out_arg
Adds an output argument to thisRequestobject.- Returns:
- an
Anyobject that contains the value and typecode for the output argument added
-
add_named_out_arg
Adds an output argument with the given name to thisRequestobject.- Parameters:
name- the name of the argument being added- Returns:
- an
Anyobject that contains the value and typecode for the output argument added
-
set_return_type
Sets the typecode for the return value of the method.- Parameters:
tc- theTypeCodeobject containing type information for the return value
-
return_value
Returns theAnyobject that contains the value for the result of the method.- Returns:
- an
Anyobject containing the value and typecode for the return value
-
invoke
public abstract void invoke()Makes a synchronous invocation using the information in theRequestobject. Exception information is placed into theRequestobject's environment object. -
send_oneway
public abstract void send_oneway()Makes a oneway invocation on the request. In other words, it does not expect or wait for a response. Note that this can be used even if the operation was not declared as oneway in the IDL declaration. No response or exception information is returned. -
send_deferred
public abstract void send_deferred()Makes an asynchronous invocation on the request. In other words, it does not wait for a response before it returns to the user. The user can then later use the methodspoll_responseandget_responseto get the result or exception information for the invocation. -
poll_response
public abstract boolean poll_response()Allows the user to determine whether a response has been received for the invocation triggered earlier with thesend_deferredmethod.- Returns:
trueif the method response has been received;falseotherwise
-
get_response
Allows the user to access the response for the invocation triggered earlier with thesend_deferredmethod.- Throws:
WrongTransaction- if the methodget_responsewas invoked from a different transaction's scope than the one from which the request was originally sent. See the OMG Transaction Service specification for details.
-