Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |
java.lang.Object | +----org.omg.CORBA.ServerRequest
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.
Method Summary | |
Context | ctx()
|
void | except(Any a)
Any object.
|
String | op_name()
|
void | params(NVList params)
|
void | result(Any a)
Any object to be used for the
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 |
public abstract String op_name()
_get_<attribute_name>
and _set_<attribute_name>
,
respectively.String
object representing
the name of the method to be invokedpublic abstract void params(NVList params)
NVList
parameter in the same order in which
they appear in the OMG IDL interface (left to right).
The ServerRequest
provides parameter values when the DIR invokes
the method params
. The NVList
provided by
the DIR to the ORB
includes the TypeCode
s (inside a NamedValue
object) for all parameters, including out
parameters
(whose values are initially nulls).
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 can always verify parameter
lists, and to detect errors such as omitted parameters, Dynamic
Implementation Routines are always required to call the method
params
. This is true
even when the DIR believes that no parameters are used by the
method. If no parameters are used,
it passes an empty NVList
object.
The methods params
and result
may be called
only once, and params
must be called before
result
. A violation results in the
exception BAD_INV_ORDER
being thrown.
params
- the arguments of the method, in the
form of an NVList
object
result
is invoked
before the method params
or if either method is called
more than oncepublic abstract void result(Any a)
Any
object to be used for the
return value for the call.
The ServerRequest
will not send a
response to the invocation
until the DIR returns. If a return value is required, the
result
method must be invoked to provide that value to the
ORB. Where no return value is required, this method need not be invoked.
The methods params
and result
may be called
only once, and params
must be called before
result
. A violation results in the
exception BAD_INV_ORDER
being thrown.
a
- the Any
object that contains the value and
typecode for the result
result
is invoked
before the method params
or if either method is called
more than oncepublic abstract void except(Any a)
Any
object.
To report an exception, rather than provide return values, the
DIR provides the exception value inside an Any
object
and passes that to the method except
.
The method except
can be called only once, after the
method params
has been called.
It may not be called if the method result
has been called. A
violation results in the BAD_INV_ORDER
exception being thrown.
a
- the Any
object containing the exception.
public abstract Context ctx()
Context
object returned will be empty if the
operation is an attribute accessor.Context
object that is to be used
to resolve any context strings whose
values need to be sent with the invocation. This
Context
object may be empty.Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |