1 | /**
|
2 | * @module component
|
3 | * @preferred
|
4 | * The root package of pip-services-components.
|
5 | */
|
6 | import { ConfigParams } from 'pip-services3-commons-node';
|
7 | import { IConfigurable } from 'pip-services3-commons-node';
|
8 | import { IReferences } from 'pip-services3-commons-node';
|
9 | import { IReferenceable } from 'pip-services3-commons-node';
|
10 | import { DependencyResolver } from 'pip-services3-commons-node';
|
11 | import { CompositeLogger } from './log/CompositeLogger';
|
12 | import { CompositeCounters } from './count/CompositeCounters';
|
13 | import { CompositeTracer } from './trace/CompositeTracer';
|
14 | /**
|
15 | * Abstract component that supportes configurable dependencies, logging
|
16 | * and performance counters.
|
17 | *
|
18 | * ### Configuration parameters ###
|
19 | *
|
20 | * - __dependencies:__
|
21 | * - [dependency name 1]: Dependency 1 locator (descriptor)
|
22 | * - ...
|
23 | * - [dependency name N]: Dependency N locator (descriptor)
|
24 | *
|
25 | * ### References ###
|
26 | *
|
27 | * - <code>\*:counters:\*:\*:1.0</code> (optional) [[ICounters]] components to pass collected measurements
|
28 | * - <code>\*:logger:\*:\*:1.0</code> (optional) [[ILogger]] components to pass log messages
|
29 | * - <code>\*:tracer:\*:\*:1.0</code> (optional) [[ITracer]] components to record traces
|
30 | * - ... References must match configured dependencies.
|
31 | */
|
32 | export declare class Component implements IConfigurable, IReferenceable {
|
33 | protected _dependencyResolver: DependencyResolver;
|
34 | protected _logger: CompositeLogger;
|
35 | protected _counters: CompositeCounters;
|
36 | protected _tracer: CompositeTracer;
|
37 | /**
|
38 | * Configures component by passing configuration parameters.
|
39 | *
|
40 | * @param config configuration parameters to be set.
|
41 | */
|
42 | configure(config: ConfigParams): void;
|
43 | /**
|
44 | * Sets references to dependent components.
|
45 | *
|
46 | * @param references references to locate the component dependencies.
|
47 | */
|
48 | setReferences(references: IReferences): void;
|
49 | }
|