- java.lang.Object
-
- org.omg.CORBA.Request
-
public abstract class Request extends Object
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
NVList
containing arguments for the operation.
Each item in the list is aNamedValue
object, which has three parts:- the name of the argument
- the value of the argument (as an
Any
object) - 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 aNamedValue
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 thecreate_request
methods in theObject
class. In other words, acreate_request
method is performed on the object which is to be invoked.- See Also:
NamedValue
-
-
Constructor Summary
Constructors Constructor and Description Request()
-
Method Summary
Methods Modifier and Type Method and Description abstract Any
add_in_arg()
Creates an input argument and adds it to thisRequest
object.abstract Any
add_inout_arg()
Adds an input/output argument to thisRequest
object.abstract Any
add_named_in_arg(String name)
Creates an input argument with the given name and adds it to thisRequest
object.abstract Any
add_named_inout_arg(String name)
Adds an input/output argument with the given name to thisRequest
object.abstract Any
add_named_out_arg(String name)
Adds an output argument with the given name to thisRequest
object.abstract Any
add_out_arg()
Adds an output argument to thisRequest
object.abstract NVList
arguments()
Retrieves theNVList
object containing the arguments to the method being invoked.abstract ContextList
contexts()
Retrieves theContextList
object for this request.abstract Context
ctx()
Retrieves theContext
object for this request.abstract void
ctx(Context c)
Sets this request'sContext
object to the one given.abstract Environment
env()
Retrieves theEnvironment
object for this request.abstract ExceptionList
exceptions()
Retrieves theExceptionList
object for this request.abstract void
get_response()
Allows the user to access the response for the invocation triggered earlier with thesend_deferred
method.abstract void
invoke()
Makes a synchronous invocation using the information in theRequest
object.abstract String
operation()
Retrieves the name of the method to be invoked.abstract boolean
poll_response()
Allows the user to determine whether a response has been received for the invocation triggered earlier with thesend_deferred
method.abstract NamedValue
result()
Retrieves theNamedValue
object containing the return value for the method.abstract Any
return_value()
Returns theAny
object that contains the value for the result of the method.abstract void
send_deferred()
Makes an asynchronous invocation on the request.abstract void
send_oneway()
Makes a oneway invocation on the request.abstract void
set_return_type(TypeCode tc)
Sets the typecode for the return value of the method.abstract Object
target()
Retrieves the the target object reference.
-
-
-
Method Detail
-
target
public abstract Object target()
Retrieves the the target object reference.- Returns:
- the object reference that points to the object implementation for the method to be invoked
-
operation
public abstract String operation()
Retrieves the name of the method to be invoked.- Returns:
- the name of the method to be invoked
-
arguments
public abstract NVList arguments()
Retrieves theNVList
object containing the arguments to the method being invoked. The elements in the list areNamedValue
objects, with each one describing an argument to the method.- Returns:
- the
NVList
object containing the arguments for the method
-
result
public abstract NamedValue result()
Retrieves theNamedValue
object containing the return value for the method.- Returns:
- the
NamedValue
object containing the result of the method
-
env
public abstract Environment env()
Retrieves theEnvironment
object for this request. It contains the exception that the method being invoked has thrown (after the invocation returns).- Returns:
- the
Environment
object for this request
-
exceptions
public abstract ExceptionList exceptions()
Retrieves theExceptionList
object for this request. This list containsTypeCode
objects describing the exceptions that may be thrown by the method being invoked.- Returns:
- the
ExceptionList
object describing the exceptions that may be thrown by the method being invoked
-
contexts
public abstract ContextList contexts()
Retrieves theContextList
object for this request. This list contains contextString
s 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
public abstract Context ctx()
Retrieves theContext
object for this request. This is a list of properties giving information about the client, the environment, or the circumstances of this request.- Returns:
- the
Context
object that is to be used to resolve any context strings whose values need to be sent with the invocation
-
ctx
public abstract void ctx(Context c)
Sets this request'sContext
object to the one given.- Parameters:
c
- the newContext
object to be used for resolving context strings
-
add_in_arg
public abstract Any add_in_arg()
Creates an input argument and adds it to thisRequest
object.- Returns:
- an
Any
object that contains the value and typecode for the input argument added
-
add_named_in_arg
public abstract Any add_named_in_arg(String name)
Creates an input argument with the given name and adds it to thisRequest
object.- Parameters:
name
- the name of the argument being added- Returns:
- an
Any
object that contains the value and typecode for the input argument added
-
add_inout_arg
public abstract Any add_inout_arg()
Adds an input/output argument to thisRequest
object.- Returns:
- an
Any
object that contains the value and typecode for the input/output argument added
-
add_named_inout_arg
public abstract Any add_named_inout_arg(String name)
Adds an input/output argument with the given name to thisRequest
object.- Parameters:
name
- the name of the argument being added- Returns:
- an
Any
object that contains the value and typecode for the input/output argument added
-
add_out_arg
public abstract Any add_out_arg()
Adds an output argument to thisRequest
object.- Returns:
- an
Any
object that contains the value and typecode for the output argument added
-
add_named_out_arg
public abstract Any add_named_out_arg(String name)
Adds an output argument with the given name to thisRequest
object.- Parameters:
name
- the name of the argument being added- Returns:
- an
Any
object that contains the value and typecode for the output argument added
-
set_return_type
public abstract void set_return_type(TypeCode tc)
Sets the typecode for the return value of the method.- Parameters:
tc
- theTypeCode
object containing type information for the return value
-
return_value
public abstract Any return_value()
Returns theAny
object that contains the value for the result of the method.- Returns:
- an
Any
object containing the value and typecode for the return value
-
invoke
public abstract void invoke()
Makes a synchronous invocation using the information in theRequest
object. Exception information is placed into theRequest
object'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_response
andget_response
to 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_deferred
method.- Returns:
true
if the method response has been received;false
otherwise
-
get_response
public abstract void get_response() throws WrongTransaction
Allows the user to access the response for the invocation triggered earlier with thesend_deferred
method.- Throws:
WrongTransaction
- if the methodget_response
was 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.
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-org/omg/CORBA/Request.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.