Creates a new instance of the container.
(optional) a container name (accessible via ContextInfo)
(optional) a container description (accessible via ContextInfo)
Adds a factory to the container. The factory is used to create components added to the container by their locators (descriptors).
a component factory to be added.
Closes component and frees used resources.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Configures component by passing configuration parameters.
configuration parameters to be set.
Checks if the component is opened.
true if the component has been opened and false otherwise.
Opens the component.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Reads container configuration from JSON or YAML file and parameterizes it with given values.
(optional) transaction id to trace execution through call chain.
a path to configuration file
values to parameters the configuration or null to skip parameterization.
Runs the container by instantiating and running components inside the container.
It reads the container configuration, creates, configures, references and opens components. On process exit it closes, unreferences and destroys components to gracefully shutdown.
command line arguments
Sets references to dependent components.
references to locate the component dependencies.
Unsets (clears) previously set references to dependent components.
Generated using TypeDoc
Inversion of control (IoC) container that runs as a system process. It processes command line arguments and handles unhandled exceptions and Ctrl-C signal to gracefully shutdown the container.
Command line arguments
--config / -c
path to JSON or YAML file with container configuration (default: "./config/config.yml")--param / --params / -p
value(s) to parameterize the container configuration--help / -h
prints the container usage helpContainer
Example
let container = new ProcessContainer(); container.addFactory(new MyComponentFactory()); container.run(process.args);