Package com.zeroc.IceGrid
Interface SessionPrx
- All Superinterfaces:
ObjectPrx,SessionPrx
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:
-
Field Summary
Fields inherited from interface com.zeroc.Ice.ObjectPrx
ice_staticId, noExplicitContext -
Method Summary
Modifier and TypeMethodDescriptiondefault ObjectPrxAllocate an object.default ObjectPrxallocateObjectById(Identity id, Map<String, String> context) Allocate an object.default CompletableFuture<ObjectPrx>Allocate an object.default CompletableFuture<ObjectPrx>allocateObjectByIdAsync(Identity id, Map<String, String> context) Allocate an object.default ObjectPrxallocateObjectByType(String type) Allocate an object with the given type.default ObjectPrxallocateObjectByType(String type, Map<String, String> context) Allocate an object with the given type.default CompletableFuture<ObjectPrx>Allocate an object with the given type.default CompletableFuture<ObjectPrx>allocateObjectByTypeAsync(String type, Map<String, String> context) Allocate an object with the given type.static SessionPrxcheckedCast(ObjectPrx obj) Contacts the remote server to verify that the object implements this type.static SessionPrxcheckedCast(ObjectPrx obj, String facet) Contacts the remote server to verify that a facet of the object implements this type.static SessionPrxContacts the remote server to verify that a facet of the object implements this type.static SessionPrxcheckedCast(ObjectPrx obj, Map<String, String> context) Contacts the remote server to verify that the object implements this type.default SessionPrxice_adapterId(String newAdapterId) Returns a proxy that is identical to this proxy, except for the adapter ID.default SessionPrxReturns a proxy that is identical to this proxy, but uses batch datagram invocations.default SessionPrxReturns a proxy that is identical to this proxy, but uses batch oneway invocations.default SessionPrxice_collocationOptimized(boolean b) Returns a proxy that is identical to this proxy, except for collocation optimization.default SessionPrxice_compress(boolean co) Returns a proxy that is identical to this proxy, except for compression.default SessionPrxice_connectionCached(boolean newCache) Returns a proxy that is identical to this proxy, except for connection caching.default SessionPrxice_connectionId(String connectionId) Returns a proxy that is identical to this proxy, except for its connection ID.default SessionPrxice_context(Map<String, String> newContext) Returns a proxy that is identical to this proxy, except for the per-proxy context.default SessionPrxReturns a proxy that is identical to this proxy, but uses datagram invocations.default SessionPrxReturns a proxy that is identical to this proxy, except for the encoding used to marshal parameters.default SessionPrxice_endpoints(Endpoint[] newEndpoints) Returns a proxy that is identical to this proxy, except for the endpoints.default SessionPrxReturns a proxy that is identical to this proxy, except for the endpoint selection policy.default SessionPrxice_fixed(Connection connection) Returns a proxy that is identical to this proxy, except it's a fixed proxy bound the given connection.@param connection The fixed proxy connection.default SessionPrxice_invocationTimeout(int newTimeout) Returns a proxy that is identical to this proxy, except for the invocation timeout.default SessionPrxice_locator(LocatorPrx locator) Returns a proxy that is identical to this proxy, except for the locator.default SessionPrxice_locatorCacheTimeout(int newTimeout) Returns a proxy that is identical to this proxy, except for the locator cache timeout.default SessionPrxReturns a proxy that is identical to this proxy, but uses oneway invocations.default SessionPrxice_preferSecure(boolean b) Returns a proxy that is identical to this proxy, except for its endpoint selection policy.default SessionPrxice_router(RouterPrx router) Returns a proxy that is identical to this proxy, except for the router.default SessionPrxice_secure(boolean b) Returns a proxy that is identical to this proxy, except for how it selects endpoints.static StringReturns the Slice type ID associated with this type.default SessionPrxice_timeout(int t) Returns a proxy that is identical to this proxy, except for its connection timeout setting.default SessionPrxReturns a proxy that is identical to this proxy, but uses twoway invocations.default voidKeep the session alive.default voidKeep the session alive.default CompletableFuture<Void>Keep the session alive.default CompletableFuture<Void>keepAliveAsync(Map<String, String> context) Keep the session alive.default voidRelease an object that was allocated usingallocateObjectByIdorallocateObjectByType.default voidreleaseObject(Identity id, Map<String, String> context) Release an object that was allocated usingallocateObjectByIdorallocateObjectByType.default CompletableFuture<Void>Release an object that was allocated usingallocateObjectByIdorallocateObjectByType.default CompletableFuture<Void>releaseObjectAsync(Identity id, Map<String, String> context) Release an object that was allocated usingallocateObjectByIdorallocateObjectByType.default voidsetAllocationTimeout(int timeout) Set the allocation timeout.default voidsetAllocationTimeout(int timeout, Map<String, String> context) Set the allocation timeout.default CompletableFuture<Void>setAllocationTimeoutAsync(int timeout) Set the allocation timeout.default CompletableFuture<Void>setAllocationTimeoutAsync(int timeout, Map<String, String> context) Set the allocation timeout.static SessionPrxuncheckedCast(ObjectPrx obj) Downcasts the given proxy to this type without contacting the remote server.static SessionPrxuncheckedCast(ObjectPrx obj, String facet) Downcasts the given proxy to this type without contacting the remote server.Methods inherited from interface com.zeroc.Ice.ObjectPrx
equals, ice_executor, ice_facet, ice_flushBatchRequests, ice_flushBatchRequestsAsync, ice_getAdapterId, ice_getCachedConnection, ice_getCommunicator, ice_getCompress, ice_getConnection, ice_getConnectionAsync, ice_getConnectionId, ice_getContext, ice_getEncodingVersion, ice_getEndpoints, ice_getEndpointSelection, ice_getFacet, ice_getIdentity, ice_getInvocationTimeout, ice_getLocator, ice_getLocatorCacheTimeout, ice_getRouter, ice_getTimeout, ice_id, ice_id, ice_idAsync, ice_idAsync, ice_identity, ice_ids, ice_ids, ice_idsAsync, ice_idsAsync, ice_invoke, ice_invoke, ice_invokeAsync, ice_invokeAsync, ice_isA, ice_isA, ice_isAAsync, ice_isAAsync, ice_isBatchDatagram, ice_isBatchOneway, ice_isCollocationOptimized, ice_isConnectionCached, ice_isDatagram, ice_isFixed, ice_isOneway, ice_isPreferSecure, ice_isSecure, ice_isTwoway, ice_ping, ice_ping, ice_pingAsync, ice_pingAsyncMethods inherited from interface com.zeroc.Glacier2.SessionPrx
destroy, destroy, destroyAsync, destroyAsync
-
Method Details
-
keepAlive
default void keepAlive()Keep the session alive. Clients should call this operation regularly to prevent the server from reaping the session. -
keepAlive
Keep the session alive. Clients should call this operation regularly to prevent the server from reaping the session.- Parameters:
context- The Context map to send with the invocation.- See Also:
-
keepAliveAsync
Keep the session alive. Clients should call this operation regularly to prevent the server from reaping the session.- Returns:
- A future that will be completed when the invocation completes.
- See Also:
-
keepAliveAsync
Keep the session alive. Clients should call this operation regularly to prevent the server from reaping the session.- Parameters:
context- The Context map to send with the invocation.- Returns:
- A future that will be completed when the invocation completes.
- See Also:
-
allocateObjectById
default ObjectPrx allocateObjectById(Identity id) 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.- 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:
-
allocateObjectById
default ObjectPrx allocateObjectById(Identity id, Map<String, String> context) throws AllocationException, ObjectNotRegisteredExceptionAllocate 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.context- The Context map to send with 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:
-
allocateObjectByIdAsync
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.- Returns:
- The proxy of the allocated object.
- See Also:
-
allocateObjectByIdAsync
default CompletableFuture<ObjectPrx> allocateObjectByIdAsync(Identity id, Map<String, String> context) 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.context- The Context map to send with the invocation.- Returns:
- The proxy of the allocated object.
- See Also:
-
allocateObjectByType
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.- Returns:
- The proxy of the allocated object.
- Throws:
AllocationException- Raised if the object could not be allocated.- See Also:
-
allocateObjectByType
default ObjectPrx allocateObjectByType(String type, Map<String, String> context) throws AllocationExceptionAllocate 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.context- The Context map to send with the invocation.- Returns:
- The proxy of the allocated object.
- Throws:
AllocationException- Raised if the object could not be allocated.- See Also:
-
allocateObjectByTypeAsync
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.- Returns:
- The proxy of the allocated object.
- See Also:
-
allocateObjectByTypeAsync
default CompletableFuture<ObjectPrx> allocateObjectByTypeAsync(String type, Map<String, String> context) 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.context- The Context map to send with the invocation.- Returns:
- The proxy of the allocated object.
- See Also:
-
releaseObject
Release an object that was allocated usingallocateObjectByIdorallocateObjectByType.- Parameters:
id- The identity of the object to release.- 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.
-
releaseObject
default void releaseObject(Identity id, Map<String, String> context) throws AllocationException, ObjectNotRegisteredExceptionRelease an object that was allocated usingallocateObjectByIdorallocateObjectByType.- Parameters:
id- The identity of the object to release.context- The Context map to send with 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.
-
releaseObjectAsync
Release an object that was allocated usingallocateObjectByIdorallocateObjectByType.- Parameters:
id- The identity of the object to release.- Returns:
- A future that will be completed when the invocation completes.
-
releaseObjectAsync
Release an object that was allocated usingallocateObjectByIdorallocateObjectByType.- Parameters:
id- The identity of the object to release.context- The Context map to send with the invocation.- Returns:
- A future that will be completed when the invocation completes.
-
setAllocationTimeout
default void setAllocationTimeout(int timeout) Set the allocation timeout. If no objects are available for an allocation request, a call toallocateObjectByIdorallocateObjectByTypewill block for the duration of this timeout.- Parameters:
timeout- The timeout in milliseconds.
-
setAllocationTimeout
Set the allocation timeout. If no objects are available for an allocation request, a call toallocateObjectByIdorallocateObjectByTypewill block for the duration of this timeout.- Parameters:
timeout- The timeout in milliseconds.context- The Context map to send with the invocation.
-
setAllocationTimeoutAsync
Set the allocation timeout. If no objects are available for an allocation request, a call toallocateObjectByIdorallocateObjectByTypewill block for the duration of this timeout.- Parameters:
timeout- The timeout in milliseconds.- Returns:
- A future that will be completed when the invocation completes.
-
setAllocationTimeoutAsync
Set the allocation timeout. If no objects are available for an allocation request, a call toallocateObjectByIdorallocateObjectByTypewill block for the duration of this timeout.- Parameters:
timeout- The timeout in milliseconds.context- The Context map to send with the invocation.- Returns:
- A future that will be completed when the invocation completes.
-
checkedCast
Contacts the remote server to verify that the object implements this type. Raises a local exception if a communication error occurs.- Parameters:
obj- The untyped proxy.- Returns:
- A proxy for this type, or null if the object does not support this type.
-
checkedCast
Contacts the remote server to verify that the object implements this type. Raises a local exception if a communication error occurs.- Parameters:
obj- The untyped proxy.context- The Context map to send with the invocation.- Returns:
- A proxy for this type, or null if the object does not support this type.
-
checkedCast
Contacts the remote server to verify that a facet of the object implements this type. Raises a local exception if a communication error occurs.- Parameters:
obj- The untyped proxy.facet- The name of the desired facet.- Returns:
- A proxy for this type, or null if the object does not support this type.
-
checkedCast
Contacts the remote server to verify that a facet of the object implements this type. Raises a local exception if a communication error occurs.- Parameters:
obj- The untyped proxy.facet- The name of the desired facet.context- The Context map to send with the invocation.- Returns:
- A proxy for this type, or null if the object does not support this type.
-
uncheckedCast
Downcasts the given proxy to this type without contacting the remote server.- Parameters:
obj- The untyped proxy.- Returns:
- A proxy for this type.
-
uncheckedCast
Downcasts the given proxy to this type without contacting the remote server.- Parameters:
obj- The untyped proxy.facet- The name of the desired facet.- Returns:
- A proxy for this type.
-
ice_context
Returns a proxy that is identical to this proxy, except for the per-proxy context.- Specified by:
ice_contextin interfaceObjectPrx- Specified by:
ice_contextin interfaceSessionPrx- Parameters:
newContext- The context for the new proxy.- Returns:
- A proxy with the specified per-proxy context.
-
ice_adapterId
Returns a proxy that is identical to this proxy, except for the adapter ID.- Specified by:
ice_adapterIdin interfaceObjectPrx- Specified by:
ice_adapterIdin interfaceSessionPrx- Parameters:
newAdapterId- The adapter ID for the new proxy.- Returns:
- A proxy with the specified adapter ID.
-
ice_endpoints
Returns a proxy that is identical to this proxy, except for the endpoints.- Specified by:
ice_endpointsin interfaceObjectPrx- Specified by:
ice_endpointsin interfaceSessionPrx- Parameters:
newEndpoints- The endpoints for the new proxy.- Returns:
- A proxy with the specified endpoints.
-
ice_locatorCacheTimeout
Returns a proxy that is identical to this proxy, except for the locator cache timeout.- Specified by:
ice_locatorCacheTimeoutin interfaceObjectPrx- Specified by:
ice_locatorCacheTimeoutin interfaceSessionPrx- Parameters:
newTimeout- The new locator cache timeout (in seconds).- Returns:
- A proxy with the specified locator cache timeout.
- See Also:
-
ice_invocationTimeout
Returns a proxy that is identical to this proxy, except for the invocation timeout.- Specified by:
ice_invocationTimeoutin interfaceObjectPrx- Specified by:
ice_invocationTimeoutin interfaceSessionPrx- Parameters:
newTimeout- The new invocation timeout (in milliseconds).- Returns:
- A proxy with the specified invocation timeout.
-
ice_connectionCached
Returns a proxy that is identical to this proxy, except for connection caching.- Specified by:
ice_connectionCachedin interfaceObjectPrx- Specified by:
ice_connectionCachedin interfaceSessionPrx- Parameters:
newCache-trueif the new proxy should cache connections;falseotherwise.- Returns:
- A proxy with the specified caching policy.
-
ice_endpointSelection
Returns a proxy that is identical to this proxy, except for the endpoint selection policy.- Specified by:
ice_endpointSelectionin interfaceObjectPrx- Specified by:
ice_endpointSelectionin interfaceSessionPrx- Parameters:
newType- The new endpoint selection policy.- Returns:
- A proxy with the specified endpoint selection policy.
- See Also:
-
ice_secure
Returns a proxy that is identical to this proxy, except for how it selects endpoints.- Specified by:
ice_securein interfaceObjectPrx- Specified by:
ice_securein interfaceSessionPrx- Parameters:
b- Ifbistrue, only endpoints that use a secure transport are used by the new proxy. Ifbis false, the returned proxy uses both secure and insecure endpoints.- Returns:
- A proxy with the specified selection policy.
-
ice_encodingVersion
Returns a proxy that is identical to this proxy, except for the encoding used to marshal parameters.- Specified by:
ice_encodingVersionin interfaceObjectPrx- Specified by:
ice_encodingVersionin interfaceSessionPrx- Parameters:
e- The encoding version to use to marshal request parameters.- Returns:
- A proxy with the specified encoding version.
-
ice_preferSecure
Returns a proxy that is identical to this proxy, except for its endpoint selection policy.- Specified by:
ice_preferSecurein interfaceObjectPrx- Specified by:
ice_preferSecurein interfaceSessionPrx- Parameters:
b- Ifbistrue, the new proxy will use secure endpoints for invocations and only use insecure endpoints if an invocation cannot be made via secure endpoints. Ifbisfalse, the proxy prefers insecure endpoints to secure ones.- Returns:
- A proxy with the specified selection policy.
-
ice_router
Returns a proxy that is identical to this proxy, except for the router.- Specified by:
ice_routerin interfaceObjectPrx- Specified by:
ice_routerin interfaceSessionPrx- Parameters:
router- The router for the new proxy.- Returns:
- A proxy with the specified router.
-
ice_locator
Returns a proxy that is identical to this proxy, except for the locator.- Specified by:
ice_locatorin interfaceObjectPrx- Specified by:
ice_locatorin interfaceSessionPrx- Parameters:
locator- The locator for the new proxy.- Returns:
- A proxy with the specified locator.
-
ice_collocationOptimized
Returns a proxy that is identical to this proxy, except for collocation optimization.- Specified by:
ice_collocationOptimizedin interfaceObjectPrx- Specified by:
ice_collocationOptimizedin interfaceSessionPrx- Parameters:
b-trueif the new proxy enables collocation optimization;falseotherwise.- Returns:
- A proxy with the specified collocation optimization.
-
ice_twoway
Returns a proxy that is identical to this proxy, but uses twoway invocations.- Specified by:
ice_twowayin interfaceObjectPrx- Specified by:
ice_twowayin interfaceSessionPrx- Returns:
- A proxy that uses twoway invocations.
-
ice_oneway
Returns a proxy that is identical to this proxy, but uses oneway invocations.- Specified by:
ice_onewayin interfaceObjectPrx- Specified by:
ice_onewayin interfaceSessionPrx- Returns:
- A proxy that uses oneway invocations.
-
ice_batchOneway
Returns a proxy that is identical to this proxy, but uses batch oneway invocations.- Specified by:
ice_batchOnewayin interfaceObjectPrx- Specified by:
ice_batchOnewayin interfaceSessionPrx- Returns:
- A proxy that uses batch oneway invocations.
-
ice_datagram
Returns a proxy that is identical to this proxy, but uses datagram invocations.- Specified by:
ice_datagramin interfaceObjectPrx- Specified by:
ice_datagramin interfaceSessionPrx- Returns:
- A proxy that uses datagram invocations.
-
ice_batchDatagram
Returns a proxy that is identical to this proxy, but uses batch datagram invocations.- Specified by:
ice_batchDatagramin interfaceObjectPrx- Specified by:
ice_batchDatagramin interfaceSessionPrx- Returns:
- A proxy that uses batch datagram invocations.
-
ice_compress
Returns a proxy that is identical to this proxy, except for compression.- Specified by:
ice_compressin interfaceObjectPrx- Specified by:
ice_compressin interfaceSessionPrx- Parameters:
co-trueenables compression for the new proxy;falsedisables compression.- Returns:
- A proxy with the specified compression setting.
-
ice_timeout
Returns a proxy that is identical to this proxy, except for its connection timeout setting.- Specified by:
ice_timeoutin interfaceObjectPrx- Specified by:
ice_timeoutin interfaceSessionPrx- Parameters:
t- The connection timeout for the proxy in milliseconds.- Returns:
- A proxy with the specified timeout.
-
ice_connectionId
Returns a proxy that is identical to this proxy, except for its connection ID.- Specified by:
ice_connectionIdin interfaceObjectPrx- Specified by:
ice_connectionIdin interfaceSessionPrx- Parameters:
connectionId- The connection ID for the new proxy. An empty string removes the connection ID.- Returns:
- A proxy with the specified connection ID.
-
ice_fixed
Returns a proxy that is identical to this proxy, except it's a fixed proxy bound the given connection.@param connection The fixed proxy connection.- Specified by:
ice_fixedin interfaceObjectPrx- Specified by:
ice_fixedin interfaceSessionPrx- Parameters:
connection- The fixed proxy connection.- Returns:
- A fixed proxy bound to the given connection.
-
ice_staticId
Description copied from interface:ObjectPrxReturns the Slice type ID associated with this type.- Returns:
- The Slice type ID.
-