module documentation

This module implements various functions for CSE startip, running, resetting, shutdown etc. It also provides various global variable that hold fixed configuration values. In addition is holds pointers to the various runtime instance of CSE modules, packages etc.

Function forceShutdown Force shutdown the CSE.
Function resetCSE Reset the CSE: Clear databases and import the resources again.
Function restartCSE Restart the CSE. This actually shuts down and terminates the CSE but with a special exit code to indicate that the CSE should be restarted.
Function run Run the CSE.
Function setConsole Set the console instance for the CSE. This is used to set the console instance from the main console plugin.
Function shutdown Gracefully shutdown the CSE programmatically. This will end the main console loop to terminate.
Function startup Startup of the CSE. Initialization of various global variables, creating and initializing of manager instances etc.
Variable console Runtime instance of the acme.plugins.runtime.Console.Console or acme.plugins.runtime.MinimalConsole.MinimalConsole.
Variable dispatcher Runtime instance of the Dispatcher.
Variable factory Runtime instance of the resource factory.
Variable importer Runtime instance of the Importer.
Variable managementSupport Runtime instance of the ManagementSupport.
Variable notification Runtime instance of the NotificationManager.
Variable pluginManager Runtime instance of the PluginManager.
Variable registration Runtime instance of the RegistrationManager.
Variable request Runtime instance of the RequestManager.
Variable script Runtime instance of the ScriptManager.
Variable security Runtime instance of the SecurityManager.
Variable storage Runtime instance of the Storage.
Variable validator Runtime instance of the Validator.
Function _shutdown Shutdown the CSE, e.g. when receiving a keyboard interrupt or at the end of the programm run.
Variable _cseResetLock Internal CSE's lock when resetting.
@provide('acme.runtime.CSE.forceShutdown')
def forceShutdown():

Force shutdown the CSE.

This is different for different platforms. On Windows, we send a SIGINT to the process, while on other platforms we raise a SIGINT signal. This is to ensure that the CSE can shutdown gracefully, even if the main thread is blocked or busy.

This function might not return, e.g. when running under Windows, where the process is killed.

@provide('acme.runtime.CSE.resetCSE')
def resetCSE():

Reset the CSE: Clear databases and import the resources again.

def restartCSE():

Restart the CSE. This actually shuts down and terminates the CSE but with a special exit code to indicate that the CSE should be restarted.

def run():

Run the CSE.

Raises
TimeoutErrorIf the CSE does not start within the specified time.
@provide('acme.runtime.CSE.setConsole')
def setConsole(consoleInstance: ConsoleBase):

Set the console instance for the CSE. This is used to set the console instance from the main console plugin.

Parameters
consoleInstance:ConsoleBaseThe console instance to set.
@provide('acme.runtime.CSE.shutdown')
def shutdown():

Gracefully shutdown the CSE programmatically. This will end the main console loop to terminate.

The actual shutdown happens in the _shutdown() method.

def startup(args: argparse.Namespace, **kwargs: dict[str, Any]) -> bool:

Startup of the CSE. Initialization of various global variables, creating and initializing of manager instances etc.

Parameters
args:argparse.NamespaceStartup command line arguments.
**kwargs:dict[str, Any]Optional, additional keyword arguments which are added as attributes to the args object.
Returns
boolFalse if the CSE couldn't initialized and started.
dispatcher: Dispatcher =

Runtime instance of the Dispatcher.

factory: Factory =

Runtime instance of the resource factory.

importer: Importer =

Runtime instance of the Importer.

managementSupport: ManagementSupport =

Runtime instance of the ManagementSupport.

notification: NotificationManager =

Runtime instance of the NotificationManager.

pluginManager: PluginManager =

Runtime instance of the PluginManager.

registration: RegistrationManager =

Runtime instance of the RegistrationManager.

request: RequestManager =

Runtime instance of the RequestManager.

Runtime instance of the ScriptManager.

security: SecurityManager =

Runtime instance of the SecurityManager.

storage: Storage =

Runtime instance of the Storage.

validator: Validator =

Runtime instance of the Validator.

@atexit.register
def _shutdown():

Shutdown the CSE, e.g. when receiving a keyboard interrupt or at the end of the programm run.

_cseResetLock =

Internal CSE's lock when resetting.