- 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 theRequest
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 singleinvoke
method. This method accepts aServerRequest
object. The abstract classServerRequest
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 ofNamedValue
objects. EachNamedValue
object contains anAny
object, which in turn has aTypeCode
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
andexcept
take anAny
object as a parameter.- See Also:
DynamicImplementation
,NVList
,NamedValue
-
-
Constructor Summary
Constructors Constructor and Description ServerRequest()
-
Method Summary
Methods Modifier and Type Method and Description void
arguments(NVList args)
Specifies method parameter types and retrieves "in" and "inout" argument values.abstract Context
ctx()
Returns the context information specified in IDL for the operation when the operation is not an attribute access and the operation's IDL definition contains a context expression; otherwise it returns a nilContext
reference.void
except(Any any)
Deprecated.use set_exception()String
op_name()
Deprecated.use operation()String
operation()
Throws anorg.omg.CORBA.NO_IMPLEMENT
exception.void
params(NVList params)
Deprecated.use the methodarguments
void
result(Any any)
Deprecated.use the methodset_result
void
set_exception(Any any)
Throws anorg.omg.CORBA.NO_IMPLEMENT
exception.void
set_result(Any any)
Throws anorg.omg.CORBA.NO_IMPLEMENT
exception.
-
-
-
Method Detail
-
op_name
@Deprecated public String op_name()
Deprecated. use operation()Retrieves 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()
Throws anorg.omg.CORBA.NO_IMPLEMENT
exception.Retrieves 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
- See Also:
CORBA
package comments for unimplemented features
-
params
@Deprecated public void params(NVList params)
Deprecated. use the methodarguments
Specifies method parameter types and retrieves "in" and "inout" argument values.Note that this method is deprecated; use the method
arguments
in its place.Unless it calls the method
set_exception
, the DIR must call this method exactly once, even if the method signature contains no parameters. Once the methodarguments
orset_exception
has been called, callingarguments
on the sameServerRequest
object will result in aBAD_INV_ORDER
system exception. The DIR must pass in to the methodarguments
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 fromarguments
, with the "in" and "inout" argument values supplied. If it does not call the methodset_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 method, in the form of anNVList
object
-
arguments
public void arguments(NVList args)
Specifies method parameter types and retrieves "in" and "inout" argument values. Unless it calls the methodset_exception
, the DIR must call this method exactly once, even if the method signature contains no parameters. Once the methodarguments
orset_exception
has been called, callingarguments
on the sameServerRequest
object will result in aBAD_INV_ORDER
system exception. The DIR must pass in to the methodarguments
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 fromarguments
, with the "in" and "inout" argument values supplied. If it does not call the methodset_exception
, the DIR must supply the returned NVList with return values for any "out" arguments before returning, and it may also change the return values for any "inout" arguments.- Parameters:
args
- the arguments of the method, in the form of an NVList- See Also:
CORBA
package comments for unimplemented features
-
result
@Deprecated public void result(Any any)
Deprecated. use the methodset_result
Specifies any return value for the call.Note that this method is deprecated; use the method
set_result
in its place.Unless the method
set_exception
is called, if the invoked method has a non-void result type, the methodset_result
must be called exactly once before the DIR returns. If the operation has a void result type, the methodset_result
may optionally be called once with anAny
object whose type istk_void
. Calling the methodset_result
before the methodarguments
has been called or after the methodset_result
orset_exception
has been called will result in a BAD_INV_ORDER exception. Calling the methodset_result
without having previously called the methodctx
when the IDL operation 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
- anAny
object containing the return value to be set
-
set_result
public void set_result(Any any)
Throws anorg.omg.CORBA.NO_IMPLEMENT
exception.Specifies any return value for the call. Unless the method
set_exception
is called, if the invoked method has a non-void result type, the methodset_result
must be called exactly once before the DIR returns. If the operation has a void result type, the methodset_result
may optionally be called once with anAny
object whose type istk_void
. Calling the methodset_result
before the methodarguments
has been called or after the methodset_result
orset_exception
has been called will result in a BAD_INV_ORDER exception. Calling the methodset_result
without having previously called the methodctx
when the IDL operation 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
- anAny
object containing the return value to be set- See Also:
CORBA
package comments for unimplemented features
-
except
@Deprecated 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
- theAny
object containing the exception
-
set_exception
public void set_exception(Any any)
Throws anorg.omg.CORBA.NO_IMPLEMENT
exception.Returns the given exception to the client. This method is invoked by the DIR, which may call it at any time. The
Any
object passed to this method must contain either a system exception or one of the user exceptions specified in the invoked operation's IDL definition. Passing in anAny
object that does not contain an exception will cause a BAD_PARAM system exception to be thrown. 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
- theAny
object containing the exception- Throws:
BAD_PARAM
- if the givenAny
object does not contain an exception or the exception is an unlisted user exceptionUNKNOWN_EXCEPTION
- if the given exception is an unlisted user exception and the DIR did not receive a BAD_PARAM exception- See Also:
CORBA
package comments for unimplemented features
-
ctx
public abstract Context ctx()
Returns the context information specified in IDL for the operation when the operation is not an attribute access and the operation's IDL definition contains a context expression; otherwise it returns a nilContext
reference. Calling the methodctx
before the methodarguments
has been called or after the methodctx
,set_result
, orset_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.
- Throws:
BAD_INV_ORDER
- if (1) the methodctx
is called before the methodarguments
or (2) the methodctx
is called after callingset_result
orset_exception
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
25/11/2024 01:11:48 Cette version de la page est en cache (à la date du 25/11/2024 01:11:48) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 16/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-org/omg/CORBA/ServerRequest.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.