PluginsManager
Extends:
Direct Subclass:
Indirect Subclass:
Constructor Summary
Public Constructor | ||
public |
constructor(arg_runtime: RuntimeBase, arg_log_context: string | undefined, arg_logger_manager: LoggerManager): nothing Create a plugins manager instance. |
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 |
get_runtime(): * |
|
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 |
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_plugin(arg_plugin: object): object Unregister a registered plugin and disble it before if needed. |
Public Constructors
Public Members
public enabled_plugins: * 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:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
arg_plugin_name | string | plugin name |
Return:
nothing |
public get_typed_plugins(arg_type_or_types: string | array): array source
Get registered plugins list with a filtered type.
Params:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
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.
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:
Name | Type | Attribute | Description |
arg_plugin | object | plugin instance. |
|
arg_position | integer | index in array (0:first or undefined) |