Java Platform 1.2
Beta 4

Class org.omg.CORBA.ServerRequest

java.lang.Object
  |
  +--org.omg.CORBA.ServerRequest

public abstract class ServerRequest
extends Object
An object that captures the explicit state of a request for the Dynamic Skeleton Interface (DSI). This class, the cornerstone of the DSI, is analogous to the Request object in the DII.

The ORB is responsible for creating this embodiment of a request, and delivering it to a Dynamic Implementation Routine (DIR). A dynamic servant (a DIR) is created by implementing the DynamicImplementation class, which has a single invoke method. This method accepts a ServerRequest object. The abstract class ServerRequest defines methods for accessing the method name, the arguments and the context of the request, as well as methods for setting the result of the request either as a return value or an exception.

A subtlety with accessing the arguments of the request is that the DIR needs to provide type information about the expected arguments, since there is no compiled information about these. This information is provided through an NVList, which is a list of NamedValue objects. Each NamedValue object contains an Any object, which in turn has a TypeCode object representing the type of the argument.

Similarly, type information needs to be provided for the response, for either the expected result or for an exception, so the methods result and except take an Any object as a parameter.

See Also:
DynamicImplementation, NVList, NamedValue

Method Summary
 void arguments(NVList args)
          Operation parameter types will be specified, and "in" and "inout" argument values will be retrieved, with arguments().
abstract  Context ctx()
          When the operation is not an attribute access, and the operation's IDL definition contains a context expression, ctx will return the context information specified in IDL for the operation.
 void except(Any any)
          Deprecated. use set_exception()
 String op_name()
          Deprecated. use operation()
 String operation()
          The operation() method returns the name of the operation being invoked; according to OMG IDL's rules, these names must be unique among all operations supported by this object's "most-derived" interface.
 void params(NVList params)
          Deprecated. arguments() provides the same functionality as params()
 void result(Any any)
          Deprecated. use set_result()
 void set_exception(Any any)
          The DIR may call set_exception at any time to return an exception to the client.
 void set_result(Any any)
          The set_result operation is used to specify any return value for the call.
 
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

Method Detail

op_name

public String op_name()
Deprecated. use operation()
The op_name() method returns the name of the operation being invoked; according to OMG IDL's rules, these names must be unique among all operations supported by this object's "most-derived" interface. Note that the operation names for getting and setting attributes are _get_<attribute_name> and _set_<attribute_name>, respectively.
Returns:
the name of the operation to be invoked

operation

public String operation()
The operation() method returns the name of the operation being invoked; according to OMG IDL's rules, these names must be unique among all operations supported by this object's "most-derived" interface. Note that the operation names for getting and setting attributes are _get_ and _set_, respectively.
Returns:
the name of the operation to be invoked

params

public void params(NVList params)
Deprecated. arguments() provides the same functionality as params()
Operation parameter types will be specified, and "in" and "inout" argument values will be retrieved, with params(). Unless it calls set_exception(), the DIR must call params() exactly once, even if the operation signature contains no parameters. Once arguments() or set_exception() has been called, calling arguments() on the same ServerRequest will result in a BAD_INV_ORDER system exception. The DIR must pass in to arguments() an NVList initialized with TypeCodes and Flags describing the parameter types for the operation, in the order in which they appear in the IDL specification (left to right). A potentially-different NVList will be returned from arguments(), with the "in" and "inout" argument values supplied. If it does not call set_exception(), the DIR must supply the returned NVList with return values for any "out" arguments before returning, and may also change the return values for any "inout" arguments.
Parameters:
params - the arguments of the operation, in the form of an NVList.

arguments

public void arguments(NVList args)
Operation parameter types will be specified, and "in" and "inout" argument values will be retrieved, with arguments(). Unless it calls set_exception(), the DIR must call arguments() exactly once, even if the operation signature contains no parameters. Once arguments() or set_exception() has been called, calling arguments() on the same ServerRequest will result in a BAD_INV_ORDER system exception. The DIR must pass in to arguments() an NVList initialized with TypeCodes and Flags describing the parameter types for the operation, in the order in which they appear in the IDL specification (left to right). A potentially-different NVList will be returned from arguments(), with the "in" and "inout" argument values supplied. If it does not call set_exception(), the DIR must supply the returned NVList with return values for any "out" arguments before returning, and may also change the return values for any "inout" arguments.
Parameters:
args - the arguments of the operation, in the form of an NVList.

result

public void result(Any any)
Deprecated. use set_result()
The result operation is used to specify any return value for the call. Unless set_exception is called, if the invoked operation has a non-void result type, set_result must be called exactly once before the DIR returns. If the operation has a void result type, set_result may optionally be called once with an Any whose type is tk_void. Calling set_result before arguments has been called or after set_result or set_exception has been called will result in a BAD_INV_ORDER exception. Calling set_result without having previously called ctx when the operation IDL contains a context expression, or when the NVList passed to arguments did not describe all parameters passed by the client, may result in a MARSHAL system exception.
Parameters:
any - the Any in which the result is stored.

set_result

public void set_result(Any any)
The set_result operation is used to specify any return value for the call. Unless set_exception is called, if the invoked operation has a non-void result type, set_result must be called exactly once before the DIR returns. If the operation has a void result type, set_result may optionally be called once with an Any whose type is tk_void. Calling set_result before arguments has been called or after set_result or set_exception has been called will result in a BAD_INV_ORDER exception. Calling set_result without having previously called ctx when the operation IDL contains a context expression, or when the NVList passed to arguments did not describe all parameters passed by the client, may result in a MARSHAL system exception.
Parameters:
any - the Any in which the result is stored.

except

public void except(Any any)
Deprecated. use set_exception()
The DIR may call set_exception at any time to return an exception to the client. The Any passed to set_exception must contain either a system exception or a user exception specified in the raises expression of the invoked operation's IDL definition. Passing in an Any that does not contain an exception will result in a BAD_PARAM system exception. Passing in an unlisted user exception will result in either the DIR receiving a BAD_PARAM system exception or in the client receiving an UNKNOWN_EXCEPTION system exception.
Parameters:
any - the Any containing the exception.

set_exception

public void set_exception(Any any)
The DIR may call set_exception at any time to return an exception to the client. The Any passed to set_exception must contain either a system exception or one of the user exceptions specified in the raises expression of the invoked operation's IDL definition. Passing in an Any that does not contain an exception will result in a BAD_PARAM system exception. Passing in an unlisted user exception will result in either the DIR receiving a BAD_PARAM system exception or in the client receiving an UNKNOWN_EXCEPTION system exception.
Parameters:
any - the Any containing the exception.

ctx

public abstract Context ctx()
When the operation is not an attribute access, and the operation's IDL definition contains a context expression, ctx will return the context information specified in IDL for the operation. Otherwise it will return a nil Context reference. Calling ctx before arguments has been called or after ctx, set_result or set_exception has been called will result in a BAD_INV_ORDER system exception.
Returns:
the context object that is to be used to resolve any context strings whose values need to be sent with the invocation.

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.