Name

Request

Synopsis

A Request represents a remote method request when using the Dynamic Invocation Interface. Request objects are created by calling the create_request() method on the org.omg.CORBA.Object reference for the remote object that will service the method request. The Request contains the name of the method to be invoked, an NVList containing NamedValue objects that represent the method arguments, and the return value for the method, if appropriate. It can also contain a description of the exceptions that the method can throw, and the client context values that the method accepts.

You add method arguments to a Request by calling one of its add_XXX() methods, which all return an Any object that you can initialize with the value of the argument. Once the Request has been initialized with its arguments and any other information, the method can be invoked synchronously using the invoke() method, asynchronously using the send_deferred() method, or in one-way mode using the send_oneway(). Immediately after the invoke() method returns, any return values or thrown exceptions are available for you to query. After calling the send_deferred() method, you can poll and retrieve the method response by calling the poll_response() and get_response() methods. If the response is ready, then get_response() will initialize the internal return value or exception in the Request object, and it can be retrieved using the return_value() method. After calling send_oneway(), no return value or ...

Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.