Reference Source
public class | source

Service

Extends:

LoggableErrorableSettingsableStateableInstance → Service

Service base class.

Example:

	API:
		->is_unknow():boolean - STATUS_UNKNOW ?
		->is_error():boolean - STATUS_ERROR ?
		->is_created():boolean - STATUS_CREATED ?
		->is_enabled():boolean - STATUS_ENABLED ?
		->is_disabled():boolean - STATUS_DISABLED ?

		->enable():boolean - Enable service.
		->disable():boolean - Disable service.

		->activate(arg_application, arg_app_svc_cfg):nothing - Activate a service feature for an application.
		->activate_on_server(arg_application, arg_server, arg_app_svc_cfg):nothing - Activate a service feature for an application on a server.

		->get_providers():Collection - Get service providers.
		->get_a_provider(arg_strategy):ServiceProvider|null - Get one service provider corresponding to the given strategy.
		->get_provider_by_app_server(arg_app_name, arg_server_name):ServiceProvider|null - Get one service provider corresponding to the given application and server.
		->create_provider(arg_name, arg_service):ServiceProvider - Create a new ServiceProvider instance for this service.
		->create_consumer():ServiceConsumer - Create a new ServiceConsumer instance.
		->provider(arg_name):ServiceProvider - Get a service provider by its name.

		->get_topology_info(arg_deep=true, arg_visited={}):object - Get topology item informations.
		->get_assets_services_names(arg_region='any'):object - Get assets services names.

Static Method Summary

Static Public Methods
public static
public static
public static
public static
public static

Constructor Summary

Public Constructor
public

constructor(arg_name: string, arg_settings: object, arg_log_context: string): nothing

Create a service instance.

Member Summary

Public Members
public

Class type flag.

public

status: *

Private Members
private
private

Method Summary

Public Methods
public

activate(arg_application: Application, arg_app_svc_cfg: object): nothing

Activate a service feature for an application.

public

activate_on_server(arg_application: Application, arg_server: Server): nothing

Activate a service feature for an application on a server.

public

Create a new ServiceConsumer instance.

public

create_provider(arg_name: string, arg_service: Service): ServiceProvider

Create a new ServiceProvider instance for this service.

public

Disable service.

public

Enable service.

public

Get one service provider corresponding to the given strategy.

public

Get assets services names.

public

get_provider_by_app_server(arg_app_name: string, arg_server_name: string): ServiceProvider | null

Get one service provider corresponding to the given application and server.

public

Get service providers.

public

get_topology_info(arg_deep: boolean, arg_visited: object): object

Get topology item informations.

public

is_created(): *

public
public

is_enabled(): *

public

is_error(): *

public

is_unknow(): *

public

Get a service provider by its name.

Inherited Summary

From class Loggable
public

Log context.

public

Class type flag.

public

Trace is enabled for this flag.

private

Logger manager instance (default undefined)

public

debug(args: string | array): nothing

Trace DEBUG formatted message.

public

disable_trace(): nothing

Disable traces.

public

enable_trace(): nothing

Enable traces.

public

enter_group(arg_group: string): nothing

Trace INFO message on "enter trace group".

public

error(args: string | array): nothing

Trace ERROR formatted message.

public

Define get class name method for non Instance classes.

public

Get instance context.

public

Get logger manager.

public

Define get instance name method for non Instance classes.

public

Get trace flag.

public

info(args: string | array): nothing

Trace INFO formatted message.

public

leave_group(arg_group: string): nothing

Trace INFO message on "leave trace group".

public

separate_level_1(): nothing

Trace INFO trace level 1 separator.

public

separate_level_2(): nothing

Trace INFO trace level 2 separator.

public

separate_level_3(): nothing

Trace INFO trace level 3 separator.

public

set_trace(arg_value: boolean): nothing

Set trace flag.

public

should_trace(arg_traces_cfg: object): boolean

Calculate should trace flag.

public

should_trace_class(arg_traces_cfg: object): boolean

Calculate should trace flag for classes.

public

should_trace_collection_item(arg_traces_cfg: object, arg_collection_name: string, arg_this_item_accessor: string): boolean

Calculate should trace flag for given collection of names or patterns.

public

should_trace_module(arg_traces_cfg: object): boolean

Calculate should trace flag for modules.

public

should_trace_name(arg_traces_cfg: object): boolean

Calculate should trace flag for instances names.

public

Toggle trace flag.

public

Update trace enabled flag.

public

warn(args: string | array): nothing

Trace WARN formatted message.

From class Errorable
private

Error text (default null).

private

Has error flag (default false).

public

error(arg_msg: string): nothing

Set an error.

public

Default helper for "not implemented" error.

public

Get error message.

public

Test is an error is set.

From class Settingsable
public

$settings: object | Immutable.Map

Instance settings (default undefined).

public

Class type flag.

public

get_setting(arg_name: string | array, arg_default: any): any

Get a value in settings for given key.

public

get_setting_js(arg_name: string | array, arg_default: any): any

Get a value in settings for given key.

public

get_settings(): Immutable.Map

Get instance settings.

public

get_settings_js(): Immutable.Map

Get instance settings.

public

has_setting(arg_name: string): boolean

Test if a key exists in settings.

public

set_setting(arg_name: string, arg_value: any): nothing

Set a value in settings for given key.

public

set_settings(arg_settings: Immutable.Map): nothing

Set instance settings.

From class Stateable
public

Class type flag.

public

state_path: array

State path in runtime state.

private

Initial state.

private

_runtime: Runtime

Runtime isntance.

private

State store.

private

State changes handlers.

public

dispatch_action(arg_action_type: string | object, arg_options: object | undefined): nothing

Dispatch a state action.

public

get_initial_state(): Immutable.Map

Get initial state, an immutable object from a Redux data store.

public

Get name.

public

Get runtime instance.

public

get_state(): Immutable.Map

Get current state, an immutable object from a Redux data store.

public

Get current state, an immutable object from a Redux data store.

public

get_state_path(): array

Get state path into a Redux data store.

public

Get state store.

public

get_state_value(arg_key_or_path: string | array, arg_default_value: any): any

Get a state entry.

public

handle_state_change(arg_previous_state: Immutable.Map, arg_new_state: Immutable.Map): nothing

Handle component state changes.

public

register_state_value_change_handle(arg_path: string | array, arg_listener: string | function): nothing

Register a state value change listener.

From class Instance
public

Instance class name.

public

Instance id.

public

Instance name.

public

Instance collection name.

public

Class type flag.

public

Instance is loaded flag.

public

Get instance class.

public

Get instance description: {$type:..., $class:..., $id:..., $name:...}.

public

Get instance description string: $type:..., $class:..., $id:..., $name:....

public

Get instance unique id.

public

Get instance unique name.

public

Get instance type.

public

Test if this code run inside a browser.

public

Test if this code run on a browser.

public abstract

load(): nothing

Load instance settings.

Static Public Methods

public static STATUS_CREATED(): * source

Return:

*

public static STATUS_DISABLED(): * source

Return:

*

public static STATUS_ENABLED(): * source

Return:

*

public static STATUS_ERROR(): * source

Return:

*

public static STATUS_UNKNOW(): * source

Return:

*

Public Constructors

public constructor(arg_name: string, arg_settings: object, arg_log_context: string): nothing source

Create a service instance.

Override:

Instance#constructor

Params:

NameTypeAttributeDescription
arg_name string

plugin name

arg_settings object

plugin settings map

arg_log_context string

trace context string.

Return:

nothing

Public Members

public is_service: boolean source

Class type flag.

public status: * source

Private Members

private _activator: * source

private _providers: * source

Public Methods

public activate(arg_application: Application, arg_app_svc_cfg: object): nothing source

Activate a service feature for an application.

Params:

NameTypeAttributeDescription
arg_application Application

Application instance.

arg_app_svc_cfg object

service configuration on application.

Return:

nothing

public activate_on_server(arg_application: Application, arg_server: Server): nothing source

Activate a service feature for an application on a server.

Params:

NameTypeAttributeDescription
arg_application Application

Application instance.

arg_server Server

Server instance.

Return:

nothing

public create_consumer(): ServiceConsumer source

Create a new ServiceConsumer instance.

Return:

ServiceConsumer

created service consumer.

public create_provider(arg_name: string, arg_service: Service): ServiceProvider source

Create a new ServiceProvider instance for this service.

Params:

NameTypeAttributeDescription
arg_name string

instance name.

arg_service Service

service instance.

Return:

ServiceProvider

created service provider.

public disable(): boolean source

Disable service.

Return:

boolean

public enable(): boolean source

Enable service.

Return:

boolean

public get_a_provider(arg_strategy: object): ServiceProvider | null source

Get one service provider corresponding to the given strategy.

Params:

NameTypeAttributeDescription
arg_strategy object

search stratgey (TODO).

Return:

ServiceProvider | null

found service provider or null

public get_assets_services_names(arg_region: string): object source

Get assets services names.

Params:

NameTypeAttributeDescription
arg_region string

region name.

Return:

object

assets { style:'', script:'', image:'', html:'' }

public get_provider_by_app_server(arg_app_name: string, arg_server_name: string): ServiceProvider | null source

Get one service provider corresponding to the given application and server.

Params:

NameTypeAttributeDescription
arg_app_name string

application name.

arg_server_name string

server name.

Return:

ServiceProvider | null

found service provider or null

public get_providers(): Collection source

Get service providers.

Return:

Collection

public get_topology_info(arg_deep: boolean, arg_visited: object): object source

Get topology item informations.

Params:

NameTypeAttributeDescription
arg_deep boolean

get deep sub items information on true (default:false).

arg_visited object

visited items plain object map.

Return:

object

topology informations (plain object).

public is_created(): * source

Return:

*

public is_disabled(): * source

Return:

*

public is_enabled(): * source

Return:

*

public is_error(): * source

Return:

*

public is_unknow(): * source

Return:

*

public provider(arg_name: string): ServiceProvider source

Get a service provider by its name.

Params:

NameTypeAttributeDescription
arg_name string

service provider name.

Return:

ServiceProvider