Up to now, we have tacitly ignored the trailing parameter of type
Ice::Current that is passed to each skeleton operation on the server side. The
Current structure is defined as follows:
Note that the
Current value provides access to information about the currently executing request to the implementation of an operation in the server:
adaptermember provides access to the object adapter via which the request is being dispatched. In turn, the adapter provides access to its communicator (via the
conmember provides information about the connection over which this request was received. If the invocation is dispatched with the collocation optimization, the
conmember is set to null.
idmember provides the object identity for the current request.
facetmember provides access to the facet for the request.
operationmember contains the name of the operation that is being invoked. Note that the operation name may indicate one of the operations on
Ice::Object, such as
ice_isAis invoked if a client performs a
modemember contains the invocation mode for the operation (
Idempotent), which influences the retry behavior of the Ice run time.
ctxmember contains the current request context for the invocation.
The Ice protocol uses request IDs to associate replies with their corresponding requests. The
requestIdmember provides this ID. For oneway requests (which do not have replies), the request ID is
The encoding version used to encode the input and output parameters.
If you implement your server such that it uses a separate servant for each Ice object, the contents of
Current are not particularly interesting. (You would most likely access
Current to read the
adapter member, for example, to activate or deactivate a servant.) However, as we will see in our discussion of default servants and servant locators, the
Current object is essential for more sophisticated (and more scalable) servant implementations.