- All Superinterfaces:
AsyncSession,Object
Represents a session object used by IceGrid clients to allocate and release objects. Client sessions are created
either via the
RegistryPrx object or via the registry client SessionManagerPrx object.
Remarks:
The Slice compiler generated this skeleton interface from Slice interface ::IceGrid::Session.
-
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) Allocates an object.allocateObjectByTypeAsync(String type, Current current) Allocates an object with the given type.default CompletionStage<OutgoingResponse>dispatch(IncomingRequest request) Dispatches an incoming request to one of the methods of this generated interface, based on the operation name carried by the request.static StringGets the type ID of the associated Slice interface.keepAliveAsync(Current current) Keeps the session alive.releaseObjectAsync(Identity id, Current current) Releases an object that was allocated usingSessionPrx.allocateObjectById(com.zeroc.Ice.Identity)orSessionPrx.allocateObjectByType(java.lang.String).setAllocationTimeoutAsync(int timeout, Current current) Sets the allocation timeout.Methods inherited from interface com.zeroc.Glacier2.AsyncSession
destroyAsync
-
Method Details
-
keepAliveAsync
Keeps the session alive.- Parameters:
current- the Current object of the incoming request- Returns:
- a completion stage that the servant will complete when the invocation completes
-
allocateObjectByIdAsync
CompletionStage<ObjectPrx> allocateObjectByIdAsync(Identity id, Current current) throws ObjectNotRegisteredException, AllocationException Allocates an object.- Parameters:
id- The identity of the object to allocate.current- the Current object of the incoming request- Returns:
- A proxy to the allocated object. This proxy is never null.
- Throws:
AllocationException- Thrown when the allocation fails.ObjectNotRegisteredException- Thrown when an object with the given identity is not registered with the registry.- See Also:
-
allocateObjectByTypeAsync
CompletionStage<ObjectPrx> allocateObjectByTypeAsync(String type, Current current) throws AllocationException Allocates an object with the given type.- Parameters:
type- The type of the object.current- the Current object of the incoming request- Returns:
- A proxy to the allocated object. This proxy is never null.
- Throws:
AllocationException- Thrown when the allocation fails.- See Also:
-
releaseObjectAsync
CompletionStage<Void> releaseObjectAsync(Identity id, Current current) throws ObjectNotRegisteredException, AllocationException Releases an object that was allocated usingSessionPrx.allocateObjectById(com.zeroc.Ice.Identity)orSessionPrx.allocateObjectByType(java.lang.String).- Parameters:
id- The identity of the object to release.current- the Current object of the incoming request- Returns:
- a completion stage that the servant will complete when the invocation completes
- Throws:
AllocationException- Thrown when the object can't be released. This can happen when the object is not allocatable or is not allocated by this session.ObjectNotRegisteredException- Thrown when an object with the given identity is not registered with the registry.
-
setAllocationTimeoutAsync
Sets the allocation timeout. When no object is immediately available for an allocation request, the implementation ofSessionPrx.allocateObjectById(com.zeroc.Ice.Identity)andSessionPrx.allocateObjectByType(java.lang.String)waits for the duration of thistimeout.- Parameters:
timeout- The timeout in milliseconds.current- the Current object of the incoming request- Returns:
- a completion stage that the servant will complete when the invocation completes
-
ice_staticId
Gets the type ID of the associated Slice interface.- Returns:
- the string "::IceGrid::Session"
-
dispatch
Dispatches an incoming request to one of the methods of this generated interface, based on the operation name carried by the request.- Specified by:
dispatchin interfaceAsyncSession- Specified by:
dispatchin interfaceObject- Parameters:
request- the incoming request- Returns:
- the outgoing response
- Throws:
UserException- if aUserExceptionis thrown, Ice will marshal it as the response payload.
-