IceGrid.SessionPrx¶
- class IceGrid.SessionPrx¶
Bases:
SessionPrxRepresents a session object used by IceGrid clients to allocate and release objects. Client sessions are created either via the
IceGrid.RegistryPrxobject or via the registry clientGlacier2.SessionManagerPrxobject.Notes
The Slice compiler generated this proxy class from Slice interface
::IceGrid::Session.- allocateObjectById(id: Identity, context: dict[str, str] | None = None) ObjectPrx | None¶
Allocates an object.
- Parameters:
- Returns:
A proxy to the allocated object. This proxy is never null.
- Return type:
ObjectPrx | None
- Raises:
AllocationException – Thrown when the allocation fails.
ObjectNotRegisteredException – Thrown when an object with the given identity is not registered with the registry.
- allocateObjectByIdAsync(id: Identity, context: dict[str, str] | None = None) Awaitable[ObjectPrx | None]¶
Allocates an object.
- allocateObjectByType(type: str, context: dict[str, str] | None = None) ObjectPrx | None¶
Allocates an object with the given type.
- allocateObjectByTypeAsync(type: str, context: dict[str, str] | None = None) Awaitable[ObjectPrx | None]¶
Allocates an object with the given type.
- static checkedCast(proxy: ObjectPrx | None, facet: str | None = None, context: dict[str, str] | None = None) SessionPrx | None¶
Creates a new proxy from an existing proxy after confirming the target object’s type via a remote invocation.
- Parameters:
- Returns:
A new proxy with the requested type, or None if the source proxy is None or if the target object does not support the requested type.
- Return type:
ObjectPrx | None
- static checkedCastAsync(proxy: ObjectPrx | None, facet: str | None = None, context: dict[str, str] | None = None) Awaitable[SessionPrx | None]¶
Creates a new proxy from an existing proxy after confirming the target object’s type via a remote invocation.
- Parameters:
- Returns:
A new proxy with the requested type, or None if the source proxy is None or if the target object does not support the requested type.
- Return type:
ObjectPrx | None
- static ice_staticId() str¶
Gets the Slice type ID of the interface associated with this proxy.
- Returns:
The type ID, “::Ice::Object”.
- Return type:
- releaseObject(id: Identity, context: dict[str, str] | None = None) None¶
Releases an object that was allocated using
IceGrid.SessionPrx.allocateObjectByIdAsync()orIceGrid.SessionPrx.allocateObjectByTypeAsync().- Parameters:
- Raises:
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.
- Return type:
None
- releaseObjectAsync(id: Identity, context: dict[str, str] | None = None) Awaitable[None]¶
Releases an object that was allocated using
IceGrid.SessionPrx.allocateObjectByIdAsync()orIceGrid.SessionPrx.allocateObjectByTypeAsync().
- setAllocationTimeout(timeout: int, context: dict[str, str] | None = None) None¶
Sets the allocation timeout. When no object is immediately available for an allocation request, the implementation of
IceGrid.SessionPrx.allocateObjectByIdAsync()andIceGrid.SessionPrx.allocateObjectByTypeAsync()waits for the duration of thistimeout.
- setAllocationTimeoutAsync(timeout: int, context: dict[str, str] | None = None) Awaitable[None]¶
Sets the allocation timeout. When no object is immediately available for an allocation request, the implementation of
IceGrid.SessionPrx.allocateObjectByIdAsync()andIceGrid.SessionPrx.allocateObjectByTypeAsync()waits for the duration of thistimeout.