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 TypeMethodDescriptionallocateObjectById(Identity id, Current current) Allocates an object.allocateObjectByType(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.voidKeeps the session alive.voidreleaseObject(Identity id, Current current) Releases an object that was allocated usingSessionPrx.allocateObjectById(com.zeroc.Ice.Identity)orSessionPrx.allocateObjectByType(java.lang.String).voidsetAllocationTimeout(int timeout, Current current) Sets the allocation timeout.
-
Method Details
-
keepAlive
Keeps the session alive.- Parameters:
current- the Current object of the incoming request
-
allocateObjectById
ObjectPrx allocateObjectById(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:
-
allocateObjectByType
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:
-
releaseObject
void releaseObject(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- 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.
-
setAllocationTimeout
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
-
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 interfaceObject- Specified by:
dispatchin interfaceSession- Parameters:
request- the incoming request- Returns:
- the outgoing response
- Throws:
UserException- if aUserExceptionis thrown, Ice will marshal it as the response payload.
-