Reference Source
public class | source

PluginsManager

Extends:

devapt-core-common/dist/js/base/errorable~Errorable → PluginsManager

Constructor Summary

Public Constructor
public

constructor(arg_runtime: RuntimeBase, arg_log_context: string | undefined, arg_logger_manager: LoggerManager): nothing

Create a plugins manager instance.

Member Summary

Public Members
public
public
public
Private Members
private

Method Summary

Public Methods
public

enabled_plugin(arg_name: string): Plugin

Get a enabled plugin by its name.

public

error_already_registered(arg_plugin_name: string): nothing

Error wrapper - on registering an already registered plugin

public

error_not_registered(arg_plugin_name: string): nothing

Error wrapper - a plugin is not registered

public

Get class name.

public

get_plugins(): array

Get registered plugins list.

public
public

get_typed_plugins(arg_type_or_types: string | array): array

Get registered plugins list with a filtered type.

public

load(arg_plugins: array): nothing

Load a map of plugins.

public

load_at_first(arg_plugin: Plugin): nothing

Load plugin at first position

public

plugin(arg_name: string, arg_enabled: boolean): Plugin

Get a registered plugin by its name and its enabled flag.

public

register_plugin(arg_plugin: object, arg_position: integer): object

Register a plugin to be used later, do not active it now.

public

registered_plugin(arg_name: string): Plugin

Get a registered plugin by its name.

public

Unregister a registered plugin and disble it before if needed.

Public Constructors

public constructor(arg_runtime: RuntimeBase, arg_log_context: string | undefined, arg_logger_manager: LoggerManager): nothing source

Create a plugins manager instance.

Params:

NameTypeAttributeDescription
arg_runtime RuntimeBase

runtime.

arg_log_context string | undefined

optional.

arg_logger_manager LoggerManager

logger manager object (optional).

Return:

nothing

Public Members

public enabled_plugins: * source

public is_plugins_manager: boolean source

public registered_plugins: * source

Private Members

private _runtime: * source

Public Methods

public enabled_plugin(arg_name: string): Plugin source

Get a enabled plugin by its name.

Params:

NameTypeAttributeDescription
arg_name string

enabled plugin name

Return:

Plugin

public error_already_registered(arg_plugin_name: string): nothing source

Error wrapper - on registering an already registered plugin

Params:

NameTypeAttributeDescription
arg_plugin_name string

plugin name

Return:

nothing

public error_not_registered(arg_plugin_name: string): nothing source

Error wrapper - a plugin is not registered

Params:

NameTypeAttributeDescription
arg_plugin_name string

plugin name

Return:

nothing

public get_class(): string source

Get class name.

Return:

string

public get_plugins(): array source

Get registered plugins list.

Return:

array

plugins list

public get_runtime(): * source

Return:

*

public get_typed_plugins(arg_type_or_types: string | array): array source

Get registered plugins list with a filtered type.

Params:

NameTypeAttributeDescription
arg_type_or_types string | array

type name or types names array

Return:

array

plugins list

public load(arg_plugins: array): nothing source

Load a map of plugins.

Params:

NameTypeAttributeDescription
arg_plugins array

plugins file name or class array.

Return:

nothing

public load_at_first(arg_plugin: Plugin): nothing source

Load plugin at first position

Params:

NameTypeAttributeDescription
arg_plugin Plugin

plugin instance

Return:

nothing

public plugin(arg_name: string, arg_enabled: boolean): Plugin source

Get a registered plugin by its name and its enabled flag.

Params:

NameTypeAttributeDescription
arg_name string

registered plugin name

arg_enabled boolean

plugin is enabled ?

Return:

Plugin

public register_plugin(arg_plugin: object, arg_position: integer): object source

Register a plugin to be used later, do not active it now.

Params:

NameTypeAttributeDescription
arg_plugin object

plugin instance.

arg_position integer

index in array (0:first or undefined)

Return:

object

a promise object of a boolean result (success:true, failure:false)

public registered_plugin(arg_name: string): Plugin source

Get a registered plugin by its name.

Params:

NameTypeAttributeDescription
arg_name string

registered plugin name

Return:

Plugin

public unregister_plugin(arg_plugin: object): object source

Unregister a registered plugin and disble it before if needed.

Params:

NameTypeAttributeDescription
arg_plugin object

plugin instance.

Return:

object

a promise object of a boolean result (success:true, failure:false)