Skip to main content

Class: PluginRegistry

A registry for managing plugins and their lifecycle.

Implements​

Constructors​

Constructor​

new PluginRegistry(): PluginRegistry

Returns​

PluginRegistry

Methods​

destroy()​

destroy(context): Promise<void>

Destroys the registered plugins by executing their onStop lifecycle method in reverse order.

Parameters​

context​

AxiSparkContext

The AxiSparkContext to be passed to the plugins during destruction.

Returns​

Promise<void>

Implementation of​

Lifecycle.destroy


getAll()​

getAll(): readonly object[]

Retrieves all registered plugins along with their options and instances.

Returns​

readonly object[]

An array of objects containing the plugin type, options, and instance.


init()​

init(context): Promise<void>

Initializes the registered plugins by executing their onRegister lifecycle method.

Parameters​

context​

AxiSparkContext

The AxiSparkContext to be passed to the plugins during initialization.

Returns​

Promise<void>

Implementation of​

Lifecycle.init


register()​

register(plugin, options?): void

Registers a new plugin with the registry.

Parameters​

plugin​

PluginType

The type of the plugin to register.

options?​

PluginOptions

The options for the plugin.

Returns​

void


run()​

run(context): Promise<void>

Starts the registered plugins by executing their onStart lifecycle method.

Parameters​

context​

AxiSparkContext

The AxiSparkContext to be passed to the plugins during startup.

Returns​

Promise<void>

Implementation of​

Lifecycle.run