Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

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
Context  ctx()
Returns the context information that was defined in the OMG IDL interface for the operation, if there is any.
void  except(Any a)
Sets the exception to the value contained in the given Any object.
String  op_name()
Returns the name of the method being invoked.
void  params(NVList params)
Sets the parameters for the method.
void  result(Any a)
Specifies the 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

op_name

public abstract String op_name()
Returns the name of the method being invoked. According to OMG IDL's rules, these names must be unique among all methods supported by this object's "most-derived" class. Note that the method names for getting and setting attributes are _get_<attribute_name> and _set_<attribute_name>, respectively.
Returns:
a String object representing the name of the method to be invoked

params

public abstract void params(NVList params)
Sets the parameters for the method. They must appear in the 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 TypeCodes (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.

Parameters:
params - the arguments of the method, in the form of an NVList object
Throws:
BAD_INV_ORDER - if the method result is invoked before the method params or if either method is called more than once

result

public abstract void result(Any a)
Specifies the 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.

Parameters:
a - the Any object that contains the value and typecode for the result
Throws:
BAD_INV_ORDER - if the method result is invoked before the method params or if either method is called more than once

except

public abstract void except(Any a)
Sets the exception to the value contained in the given 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.

Parameters:
a - the Any object containing the exception.

ctx

public abstract Context ctx()
Returns the context information that was defined in the OMG IDL interface for the operation, if there is any. The Context object returned will be empty if the operation is an attribute accessor.
Returns:
the 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

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.