Package com.zeroc.IceGrid
Interface Session
A session object is used by IceGrid clients to allocate and
release objects. Client sessions are created either via the
Registry
object or via the registry client SessionManager
object.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.zeroc.Ice.Object
Object.Ice_invokeResult
-
Method Summary
Modifier and TypeMethodDescriptionallocateObjectByIdAsync
(Identity id, Current current) Allocate an object.allocateObjectByTypeAsync
(String type, Current current) Allocate an object with the given type.default String
Returns the Slice type ID of the most-derived interface supported by this object.default String[]
Returns the Slice type IDs of the interfaces supported by this object.static String
Returns the Slice type ID of the interface supported by this object.void
Keep the session alive.void
releaseObject
(Identity id, Current current) Release an object that was allocated usingallocateObjectById
orallocateObjectByType
.void
setAllocationTimeout
(int timeout, Current current) Set the allocation timeout.Methods inherited from interface com.zeroc.Ice.Object
ice_dispatch, ice_isA, ice_ping
-
Method Details
-
keepAlive
Keep the session alive. Clients should call this operation regularly to prevent the server from reaping the session.- Parameters:
current
- The Current object for the invocation.- See Also:
-
allocateObjectByIdAsync
CompletionStage<ObjectPrx> allocateObjectByIdAsync(Identity id, Current current) throws AllocationException, ObjectNotRegisteredException Allocate an object. Depending on the allocation timeout, this operation might hang until the object is available or until the timeout is reached.- Parameters:
id
- The identity of the object to allocate.current
- The Current object for the invocation.- Returns:
- The proxy of the allocated object.
- Throws:
AllocationException
- Raised if the object can't be allocated.ObjectNotRegisteredException
- Raised if the object with the given identity is not registered with the registry.- See Also:
-
allocateObjectByTypeAsync
CompletionStage<ObjectPrx> allocateObjectByTypeAsync(String type, Current current) throws AllocationException Allocate an object with the given type. Depending on the allocation timeout, this operation can block until an object becomes available or until the timeout is reached.- Parameters:
type
- The type of the object.current
- The Current object for the invocation.- Returns:
- The proxy of the allocated object.
- Throws:
AllocationException
- Raised if the object could not be allocated.- See Also:
-
releaseObject
void releaseObject(Identity id, Current current) throws AllocationException, ObjectNotRegisteredException Release an object that was allocated usingallocateObjectById
orallocateObjectByType
.- Parameters:
id
- The identity of the object to release.current
- The Current object for the invocation.- Throws:
AllocationException
- Raised if the given object can't be released. This might happen if the object isn't allocatable or isn't allocated by the session.ObjectNotRegisteredException
- Raised if the object with the given identity is not registered with the registry.
-
setAllocationTimeout
Set the allocation timeout. If no objects are available for an allocation request, a call toallocateObjectById
orallocateObjectByType
will block for the duration of this timeout.- Parameters:
timeout
- The timeout in milliseconds.current
- The Current object for the invocation.
-
ice_ids
Description copied from interface:Object
Returns the Slice type IDs of the interfaces supported by this object.- Specified by:
ice_ids
in interfaceObject
- Specified by:
ice_ids
in interfaceSession
- Parameters:
current
- TheCurrent
object for the invocation.- Returns:
- The Slice type IDs of the interfaces supported by this object, in base-to-derived
order. The first element of the returned array is always
::Ice::Object
.
-
ice_id
Description copied from interface:Object
Returns the Slice type ID of the most-derived interface supported by this object. -
ice_staticId
Description copied from interface:Object
Returns the Slice type ID of the interface supported by this object.- Returns:
- The return value is always ::Ice::Object.
-