kernel/modules/module-host
Classes
Section titled “Classes”ModuleHost
Section titled “ModuleHost”Defined in: app/src/kernel/modules/module-host.ts:53
Activates and deactivates feature modules. Only active modules have their code imported; a module that fails is isolated and its dependents stay inactive. A failing core module stops the start.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ModuleHost(
registry,source,parent,logger,clock):ModuleHost
Defined in: app/src/kernel/modules/module-host.ts:85
Parameters
Section titled “Parameters”registry
Section titled “registry”The module graph.
source
Section titled “source”Decides about optional modules.
parent
Section titled “parent”Container that module containers are children of.
logger
Section titled “logger”Parent logger; modules get module.<id> loggers.
Measures load and activation times.
Returns
Section titled “Returns”Properties
Section titled “Properties”onDidChangeStatus
Section titled “onDidChangeStatus”
readonlyonDidChangeStatus:Event<ModuleStatus>
Defined in: app/src/kernel/modules/module-host.ts:76
Fires when the status of a module changes.
inject
Section titled “inject”
readonlystaticinject: readonly [Token<ModuleRegistry>,Token<ActivationSource>,Token<Container>,Token<Logger>,Token<Clock>]
Defined in: app/src/kernel/modules/module-host.ts:54
Methods
Section titled “Methods”dispose()
Section titled “dispose()”dispose():
void
Defined in: app/src/kernel/modules/module-host.ts:145
Disposes all module containers without awaiting deactivate. Prefer ModuleHost.stop.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”isActive()
Section titled “isActive()”isActive(
id):boolean
Defined in: app/src/kernel/modules/module-host.ts:133
Tells whether a module is active.
Parameters
Section titled “Parameters”string
The module id.
Returns
Section titled “Returns”boolean
refresh()
Section titled “refresh()”refresh():
Promise<void>
Defined in: app/src/kernel/modules/module-host.ts:116
Re-evaluates the activation source after a setting or policy changed. Modules that became inactive are deactivated in reverse order; new ones are activated. Modules that require a restart only change their status.
Returns
Section titled “Returns”Promise<void>
start()
Section titled “start()”start():
Promise<void>
Defined in: app/src/kernel/modules/module-host.ts:103
Activates every module of the activation plan, dependencies first.
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”ModuleError when a core module fails to activate.
status()
Section titled “status()”status(): readonly
ModuleStatus[]
Defined in: app/src/kernel/modules/module-host.ts:138
Status of every registered module, in registration order.
Returns
Section titled “Returns”readonly ModuleStatus[]
stop()
Section titled “stop()”stop():
Promise<void>
Defined in: app/src/kernel/modules/module-host.ts:121
Deactivates every active module in reverse activation order.
Returns
Section titled “Returns”Promise<void>
Interfaces
Section titled “Interfaces”ModuleStatus
Section titled “ModuleStatus”Defined in: app/src/kernel/modules/module-host.ts:21
Status of one module, as shown on the diagnostics page.
Properties
Section titled “Properties”activateMs?
Section titled “activateMs?”
readonlyoptionalactivateMs?:number
Defined in: app/src/kernel/modules/module-host.ts:29
Time spent in activate, in milliseconds.
error?
Section titled “error?”
readonlyoptionalerror?:string
Defined in: app/src/kernel/modules/module-host.ts:31
Message of the error that made the module fail.
readonlyid:string
Defined in: app/src/kernel/modules/module-host.ts:22
loadMs?
Section titled “loadMs?”
readonlyoptionalloadMs?:number
Defined in: app/src/kernel/modules/module-host.ts:27
Time spent importing the module’s code, in milliseconds.
reason?
Section titled “reason?”
readonlyoptionalreason?:InactiveReason
Defined in: app/src/kernel/modules/module-host.ts:25
Why the module is inactive.
readonlystate:ModuleState
Defined in: app/src/kernel/modules/module-host.ts:23
Type Aliases
Section titled “Type Aliases”ModuleState
Section titled “ModuleState”ModuleState =
"inactive"|"active"|"failed"|"restart-required"
Defined in: app/src/kernel/modules/module-host.ts:18
State of a module in the ModuleHost.
Variables
Section titled “Variables”ModuleHostToken
Section titled “ModuleHostToken”
constModuleHostToken:Token<ModuleHost>
Defined in: app/src/kernel/modules/module-host.ts:46
Token for the ModuleHost.
ModuleParentContainerToken
Section titled “ModuleParentContainerToken”Defined in: app/src/kernel/modules/module-host.ts:42
Token for the container that module containers are created from.