1 | import Config from '../config/ConfigProvider';
|
2 | import { Logger } from '../log/LogManager';
|
3 | import { Lifecycle } from './Lifecycle';
|
4 | import { ObjectDefinition } from './objectdefinition/ObjectDefinition';
|
5 | import { ObjectDefinitionInspector } from './ObjectDefinitionInspector';
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export interface ContextOptions {
|
12 | logger?: Logger;
|
13 | config?: Config;
|
14 | shutdownTimer?: number;
|
15 | }
|
16 | export declare class Context extends Lifecycle {
|
17 | private objectDefinitionInspector;
|
18 | private startedObjects;
|
19 | private objectDefinitions;
|
20 | private parentContext;
|
21 | private config;
|
22 | private objectGroups;
|
23 | private shutdownTimer;
|
24 | constructor(name: string, parentContext?: Context, options?: ContextOptions);
|
25 | lcStart(): Promise<void>;
|
26 | lcStop(): Promise<void>;
|
27 | protected doStart(): Promise<void>;
|
28 | protected doStop(): Promise<any>;
|
29 | clone(name: any): Context;
|
30 | importContext(otherContext: any, overwrite?: boolean): void;
|
31 | addObjectDefinitionInspector(inspector: ObjectDefinitionInspector): void;
|
32 | registerDefinition(objectDefinition: ObjectDefinition<any>, overwrite?: boolean): void;
|
33 | registerSingletons(...singletons: any[]): void;
|
34 | registerSingletonsInDir(patterns: any, options: any): void;
|
35 | static requireFilesInDir(dir: any): void;
|
36 | /**
|
37 | * Walks a directory recursively and returns an array with all the files
|
38 | *
|
39 | * @private
|
40 | * @param dir The directory to walk through
|
41 | * @param filelist The carried-over list of files
|
42 | * @return {Array} The list of files in this directory and subdirs
|
43 | */
|
44 | static walkDirSync(dir: any, filelist?: any[]): any[];
|
45 | |
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 | static findMatchingFiles(patterns: string | Array<string>, {isGlob, globOptions}: {
|
54 | isGlob: boolean;
|
55 | globOptions: Object;
|
56 | }): Array<string>;
|
57 | |
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | getConfig(key: string, defaultValue?: any): any;
|
70 | |
71 |
|
72 |
|
73 |
|
74 |
|
75 | hasConfig(key: string): boolean;
|
76 | addObjectNameToGroup(groupName: string, objectName: string): void;
|
77 | getGroupObjectNames(groupName: string): string[];
|
78 | getObjectByName(beanName: string): Promise<any>;
|
79 | getObjectByType(className: string): Promise<any>;
|
80 | getObjectsByType(className: string): Promise<any[]>;
|
81 | getObjectsByGroup(groupName: string): Promise<any[]>;
|
82 | getDefinitionByName(objectName: string): ObjectDefinition<any>;
|
83 | getDefinitionByType(className: string): ObjectDefinition<any>;
|
84 | getDefinitionsByType(className: string, failOnMissing?: boolean): Array<ObjectDefinition<any>>;
|
85 | getDefinitionsByGroup(groupName: string): Array<ObjectDefinition<any>>;
|
86 | applyObjectDefinitionModifiers(): void;
|
87 | }
|