All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----org.omg.CORBA.ServerRequest
The ORB is responsible for creating this embodiment of a request, and delivering it to a Dynamic Implementation Routine (DIR). This is an instance of the DynamicImplementation interface. A dynamic servant is created by implementing the DynamicImplementation interface, which has a single invoke operation that accepts a ServerRequest.
The ServerRequest interface defines operations to access the operation name, the arguments and the context of the request, as well as operations to set the response of the request either as a result or an exception.
A subtlety with accessing the arguments of the request is that the DynamicImplementation 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 NamedValues. Each NamedValue contains an Any that has a TypeCode representing the type of the corresponding argument.
Similarly, type information needs to be provided for the response, for either the expected result or for an exception.
public ServerRequest()
public abstract String op_name() throws SystemException
public abstract void params(NVList params) throws SystemException
The ServerRequest provides parameter values when the DIR invokes the params() operation. The NVList provided by the DIR to the ORB includes the TypeCodes (inside a NamedValue) for all parameters, including out ones (their values are nulls at first), for the operation. This allows the ORB to verify that the correct parameter types have been provided before filling their values in, but does not require it to do so. It also relieves the ORB of all responsibility to consult the interface repository, promoting high performance implementations.
In order to guarantee that the ORB could always verify parameter lists, and to detect errors such as omitted parameters, Dynamic Implementation Routines are always required to call params(), even when the DIR believes that no parameters are used by the operation. When the DIR believes no parameters are used by the operation, it passes an empty NVList.
The params() and result() operations may be called only once, and in that exact order. A violation results in the BAD_OPERATION exception being thrown.
public abstract void result(Any result) throws SystemException
The ServerRequest will not send a response to the invocation until the DIR returns. If a return value is required, the result() operation must be invoked to provide that value to the ORB. Where no return value is required, this need not be invoked.
The params() and result() operations may be called only once, and in that exact order. A violation results in the BAD_OPERATION exception being thrown.
public abstract void except(Any exc) throws SystemException
The exception() routine can be called only once, after params() is called. It may not be called if result() has been called. A violation results in the BAD_OPERATION exception being thrown.
public abstract Context ctx() throws SystemException
All Packages Class Hierarchy This Package Previous Next Index