IceBox package¶
Module contents¶
- exception IceBox.AlreadyStartedException¶
Bases:
UserException
The exception that is thrown when attempting to start a service that is already running.
- Return type:
None
- exception IceBox.AlreadyStoppedException¶
Bases:
UserException
The exception that is thrown when attempting to stop a service that is already stopped.
- Return type:
None
- exception IceBox.NoSuchServiceException¶
Bases:
UserException
The exception that is thrown when a service name does not refer to a known service.
- Return type:
None
- class IceBox.ServiceManager¶
Bases:
Object
,ABC
- abstractmethod addObserver(observer: ServiceObserverPrx | None, current: Current) None | Awaitable[None] ¶
Registers a new observer with this service manager.
- Parameters:
observer (ServiceObserverPrx | None) – The new observer.
current (Ice.Current) – The Current object for the dispatch.
- Returns:
None or an awaitable that completes when the dispatch completes.
- Return type:
None | Awaitable[None]
- static ice_staticId() str ¶
Obtain the type ID of the Slice interface.
- Returns:
The type ID.
- Return type:
str
- abstractmethod shutdown(current: Current) None | Awaitable[None] ¶
Shuts down all services.
- Parameters:
current (Ice.Current) – The Current object for the dispatch.
- Returns:
None or an awaitable that completes when the dispatch completes.
- Return type:
None | Awaitable[None]
- abstractmethod startService(service: str, current: Current) None | Awaitable[None] ¶
Starts a service.
- Parameters:
service (str) – The service name.
current (Ice.Current) – The Current object for the dispatch.
- Returns:
None or an awaitable that completes when the dispatch completes.
- Return type:
None | Awaitable[None]
- Raises:
AlreadyStartedException – Thrown when the service is already running.
NoSuchServiceException – Thrown when IceBox does not know a service named
service
.
- abstractmethod stopService(service: str, current: Current) None | Awaitable[None] ¶
Stops a service.
- Parameters:
service (str) – The service name.
current (Ice.Current) – The Current object for the dispatch.
- Returns:
None or an awaitable that completes when the dispatch completes.
- Return type:
None | Awaitable[None]
- Raises:
AlreadyStoppedException – Thrown when the service is already stopped.
NoSuchServiceException – Thrown when IceBox does not know a service named
service
.
- class IceBox.ServiceManagerPrx¶
Bases:
ObjectPrx
- addObserver(observer: ServiceObserverPrx | None, context: dict[str, str] | None = None) None ¶
Registers a new observer with this service manager.
- Parameters:
observer (ServiceObserverPrx | None) – The new observer.
context (dict[str, str]) – The request context for the invocation.
- Return type:
None
- addObserverAsync(observer: ServiceObserverPrx | None, context: dict[str, str] | None = None) Awaitable[None] ¶
Registers a new observer with this service manager.
- Parameters:
observer (ServiceObserverPrx | None) – The new observer.
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 checkedCast(proxy: ObjectPrx | None, facet: str | None = None, context: dict[str, str] | None = None) ServiceManagerPrx | 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[ServiceManagerPrx | 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
- shutdown(context: dict[str, str] | None = None) None ¶
Shuts down all services.
- Parameters:
context (dict[str, str]) – The request context for the invocation.
- Return type:
None
- shutdownAsync(context: dict[str, str] | None = None) Awaitable[None] ¶
Shuts down all services.
- 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]
- startService(service: str, context: dict[str, str] | None = None) None ¶
Starts a service.
- Parameters:
service (str) – The service name.
context (dict[str, str]) – The request context for the invocation.
- Raises:
AlreadyStartedException – Thrown when the service is already running.
NoSuchServiceException – Thrown when IceBox does not know a service named
service
.
- Return type:
None
- startServiceAsync(service: str, context: dict[str, str] | None = None) Awaitable[None] ¶
Starts a service.
- Parameters:
service (str) – The service name.
context (dict[str, str]) – The request context for the invocation.
- Returns:
An awaitable that is completed when the invocation completes.
- Return type:
Awaitable[None]
- stopService(service: str, context: dict[str, str] | None = None) None ¶
Stops a service.
- Parameters:
service (str) – The service name.
context (dict[str, str]) – The request context for the invocation.
- Raises:
AlreadyStoppedException – Thrown when the service is already stopped.
NoSuchServiceException – Thrown when IceBox does not know a service named
service
.
- Return type:
None
- stopServiceAsync(service: str, context: dict[str, str] | None = None) Awaitable[None] ¶
Stops a service.
- Parameters:
service (str) – The service name.
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 | None, facet: str | None = None) ServiceManagerPrx | None ¶
Creates a new proxy from an existing proxy.
- class IceBox.ServiceObserver¶
Bases:
Object
,ABC
- static ice_staticId() str ¶
Obtain the type ID of the Slice interface.
- Returns:
The type ID.
- Return type:
str
- abstractmethod servicesStarted(services: list[str], current: Current) None | Awaitable[None] ¶
Receives the names of the services that were started.
- Parameters:
services (list[str]) – The names of the services that were started.
current (Ice.Current) – The Current object for the dispatch.
- Returns:
None or an awaitable that completes when the dispatch completes.
- Return type:
None | Awaitable[None]
- abstractmethod servicesStopped(services: list[str], current: Current) None | Awaitable[None] ¶
Receives the names of the services that were stopped.
- Parameters:
services (list[str]) – The names of the services that were stopped.
current (Ice.Current) – The Current object for the dispatch.
- Returns:
None or an awaitable that completes when the dispatch completes.
- Return type:
None | Awaitable[None]
- class IceBox.ServiceObserverPrx¶
Bases:
ObjectPrx
- static checkedCast(proxy: ObjectPrx | None, facet: str | None = None, context: dict[str, str] | None = None) ServiceObserverPrx | 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[ServiceObserverPrx | 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
- servicesStarted(services: Sequence[str], context: dict[str, str] | None = None) None ¶
Receives the names of the services that were started.
- Parameters:
services (Sequence[str]) – The names of the services that were started.
context (dict[str, str]) – The request context for the invocation.
- Return type:
None
- servicesStartedAsync(services: Sequence[str], context: dict[str, str] | None = None) Awaitable[None] ¶
Receives the names of the services that were started.
- Parameters:
services (Sequence[str]) – The names of the services that were started.
context (dict[str, str]) – The request context for the invocation.
- Returns:
An awaitable that is completed when the invocation completes.
- Return type:
Awaitable[None]
- servicesStopped(services: Sequence[str], context: dict[str, str] | None = None) None ¶
Receives the names of the services that were stopped.
- Parameters:
services (Sequence[str]) – The names of the services that were stopped.
context (dict[str, str]) – The request context for the invocation.
- Return type:
None
- servicesStoppedAsync(services: Sequence[str], context: dict[str, str] | None = None) Awaitable[None] ¶
Receives the names of the services that were stopped.
- Parameters:
services (Sequence[str]) – The names of the services that were stopped.
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 | None, facet: str | None = None) ServiceObserverPrx | None ¶
Creates a new proxy from an existing proxy.