IceGrid.SessionPrx

class IceGrid.SessionPrx

Bases: SessionPrx

Represents a session object used by IceGrid clients to allocate and release objects. Client sessions are created either via the IceGrid.RegistryPrx object or via the registry client Glacier2.SessionManagerPrx object.

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:
  • id (Identity) – The identity of the object to allocate.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

A proxy to the allocated object. This proxy is never null.

Return type:

ObjectPrx | None

Raises:
allocateObjectByIdAsync(id: Identity, context: dict[str, str] | None = None) Awaitable[ObjectPrx | None]

Allocates an object.

Parameters:
  • id (Identity) – The identity of the object to allocate.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

A proxy to the allocated object. This proxy is never null.

Return type:

Awaitable[ObjectPrx | None]

allocateObjectByType(type: str, context: dict[str, str] | None = None) ObjectPrx | None

Allocates an object with the given type.

Parameters:
  • type (str) – The type of the object.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

A proxy to the allocated object. This proxy is never null.

Return type:

ObjectPrx | None

Raises:

AllocationException – Thrown when the allocation fails.

allocateObjectByTypeAsync(type: str, context: dict[str, str] | None = None) Awaitable[ObjectPrx | None]

Allocates an object with the given type.

Parameters:
  • type (str) – The type of the object.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

A proxy to the allocated object. This proxy is never null.

Return type:

Awaitable[ObjectPrx | None]

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:
  • proxy (ObjectPrx | None) – The source proxy.

  • facet (str, optional) – A facet name.

  • context (dict[str, str], optional) – The request context.

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:
  • proxy (ObjectPrx | None) – The source proxy.

  • facet (str, optional) – A facet name.

  • context (dict[str, str], optional) – The request context.

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:

str

keepAlive(context: dict[str, str] | None = None) None

Keeps the session alive.

Parameters:

context (dict[str, str]) – The request context for the invocation.

Return type:

None

keepAliveAsync(context: dict[str, str] | None = None) Awaitable[None]

Keeps the session alive.

Parameters:

context (dict[str, str]) – The request context for the invocation.

Returns:

An awaitable that is completed when the invocation completes.

Return type:

Awaitable[None]

releaseObject(id: Identity, context: dict[str, str] | None = None) None

Releases an object that was allocated using IceGrid.SessionPrx.allocateObjectByIdAsync() or IceGrid.SessionPrx.allocateObjectByTypeAsync().

Parameters:
  • id (Identity) – The identity of the object to release.

  • context (dict[str, str]) – The request context for the invocation.

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() or IceGrid.SessionPrx.allocateObjectByTypeAsync().

Parameters:
  • id (Identity) – The identity of the object to release.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

An awaitable that is completed when the invocation completes.

Return type:

Awaitable[None]

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() and IceGrid.SessionPrx.allocateObjectByTypeAsync() waits for the duration of this timeout.

Parameters:
  • timeout (int) – The timeout in milliseconds.

  • context (dict[str, str]) – The request context for the invocation.

Return type:

None

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() and IceGrid.SessionPrx.allocateObjectByTypeAsync() waits for the duration of this timeout.

Parameters:
  • timeout (int) – The timeout in milliseconds.

  • context (dict[str, str]) – The request context for the invocation.

Returns:

An awaitable that is completed when the invocation completes.

Return type:

Awaitable[None]

static uncheckedCast(proxy: ObjectPrx, facet: str | None = None) SessionPrx
static uncheckedCast(proxy: None, facet: str | None = None) None

Creates a new proxy from an existing proxy.

Parameters:
  • proxy (ObjectPrx | None) – The source proxy.

  • facet (str, optional) – A facet name.

Returns:

A new proxy with the requested type, or None if the source proxy is None.

Return type:

ObjectPrx | None