Protected
applicationThe Unit classes registered with the app.
Protected
baseThe fully-qualified path to the base directory of the app.
Protected
baseResolved universal path to the base directory of the app.
Protected
blueprintCollection of subscriptions to ContainerBlueprint events. We keep this around so we can remove the subscriptions when the container is destroyed.
Protected
factoriesCollection of factories registered with this container.
If true, the "Starting Extollo..." messages will always be logged.
Protected
instancesCollection of singleton instances produced by this container.
Protected
instantiatedInstances of the units registered with this app.
Protected
staticCollection of static-class overrides registered with this container.
Protected
waitingCollection of created objects that should have lifecycle events called on them, if they still exist.
Protected
waitingCollection of callbacks waiting for a dependency key to be resolved.
Static
Readonly
NODE_Static
Protected
Optional
makeThe 100 most recent dependency keys that were make
'd. Used to help with
debugging cyclic dependency errors.
Static
Protected
Optional
makeList of dependency keys currently being make
'd as a reverse stack.
This is used to detect dependency cycles.
Static
Protected
realizingSet to true when we're realizing a container.
Used to prevent infinite recursion when getContainer()
is accidentally called
from somewhere within the realizeContainer()
call.
Returns a UniversalPath to the app/
directory in the application.
Get an instance of the RunLevelErrorHandler.
Get an instance of the RunLevelErrorHandler.
Return a UniversalPath to the root of the application.
Static
NODE_Resolve a path relative to the app/
directory in the application.
Rest
...parts: PathLike[]Protected
bootstrapProtected
checkGiven a different container, copy the factories and instances from this container over to it.
Wrap a base Error instance into an ErrorWithContext.
Get a collection of dependency keys required by the given target, if it is registered with this container.
Get the static class overriding the base class.
Returns true if a static override exists for the given base class.
Create an instance of the given target. The target can either be a DependencyKey registered with this container (in which case, the singleton value will be returned), or an instantiable class.
If the instantiable class has the Injectable decorator, its injectable parameters will be automatically injected into the instance.
Rest
...parameters: any[]Get the registered instance of the static override of a given class.
Rest
...parameters: any[]Resolve a path relative to the root of the application.
Rest
...parts: PathLike[]Protected
produceGiven a factory and manually-provided parameters, resolve the dependencies for the factory and produce its value.
Purge all factories and instances of the given key from this container.
Register a basic instantiable class as a standard Factory with this container.
Register a given factory with the container.
Register a basic instantiable class as a standard Factory with this container, identified by a string name rather than static class.
unique name to identify the factory in the container
Register the given function as a factory within the container.
unique name to identify the factory in the container
factory to produce a value
Register a value as a singleton in the container. It will not be instantiated, but can be injected by its unique name.
unique name to identify the singleton in the container
Register a static class to the container along with its already-instantiated instance that will be used to resolve the class.
Register a static class as an override of some base class.
Remove all stored instances of the given key from this container.
Find the factory for the given key, if one is registered with this container.
Resolve the dependency key. If a singleton value for that key already exists in this container, return that value. Otherwise, use the factory and given parameters to produce and return the value.
Rest
...parameters: any[]Protected
setupStatic
getGet the global application instance.
Static
getStatic
realizeGiven a Container instance, apply the ContainerBlueprint to it.
The main application container.