ing
This commit is contained in:
parent
7c45f214ff
commit
4f5f937901
|
@ -1,4 +1,4 @@
|
|||
interface ApplicationStater {
|
||||
export interface ApplicationStater {
|
||||
start(): void;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,16 +15,16 @@ import {
|
|||
ConfigurationAnnotation,
|
||||
} from '@loafer/context/decorator/Configuration';
|
||||
|
||||
export class AppAnnotation extends ConfigurationAnnotation implements DecoratorHandler {
|
||||
export class ApplicationAnnotation extends ConfigurationAnnotation implements DecoratorHandler {
|
||||
public constructor(qualifier?: PropertyType) {
|
||||
super(qualifier);
|
||||
}
|
||||
public onClassDecorator = <TFunction extends Function>(clazz: Class, target: TFunction): TFunction | void => {
|
||||
console.log('App');
|
||||
console.log('Application');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const App = Decorator.create(AppAnnotation);
|
||||
export const Application = Decorator.create(ApplicationAnnotation);
|
||||
|
||||
export default App;
|
||||
export default Application;
|
|
@ -6,13 +6,6 @@ import ApplicationContext from '@loafer/context/ApplicationContext';
|
|||
import Lifecycle from '@loafer/context/Lifecycle';
|
||||
|
||||
export interface ConfigurableApplicationContext extends ApplicationContext, Lifecycle {
|
||||
setId(id: PropertyType): void;
|
||||
setEnvironment(environment: ConfigurableEnvironment): void;
|
||||
getEnvironment(): ConfigurableEnvironment;
|
||||
addBeanFactoryPostProcessor(BeanFactoryPostProcessor postProcessor): void;
|
||||
addApplicationListener(ApplicationListener< ? > listener ): void;
|
||||
refresh(): void;
|
||||
getBeanFactory(): ConfigurableListablePouchFactory;
|
||||
}
|
||||
|
||||
export default ConfigurableApplicationContext;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import AbstractApplicationContext from '@loafer/context/support/AbstractApplicationContext';
|
||||
import PouchDefinitionRegistry from '@loafer/pouches/factory/support/PouchDefinitionRegistry';
|
||||
|
||||
export class GenericApplicationContext extends AbstractApplicationContext {
|
||||
|
||||
|
||||
export class GenericApplicationContext extends AbstractApplicationContext implements PouchDefinitionRegistry {
|
||||
|
||||
}
|
||||
|
||||
|
|
8
src/ts/@loafer/core/AliasRegistry.ts
Normal file
8
src/ts/@loafer/core/AliasRegistry.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import {
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
export interface AliasRegistry {
|
||||
}
|
||||
|
||||
export default AliasRegistry;
|
15
src/ts/@loafer/core/MethodParameter.ts
Normal file
15
src/ts/@loafer/core/MethodParameter.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import {
|
||||
ClassType,
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
import Executable from '@loafer/core/reflect/Executable';
|
||||
import Parameter from '@loafer/core/reflect/Parameter';
|
||||
import Method from '@loafer/core/reflect/Method';
|
||||
import Constructor from '@loafer/core/reflect/Constructor';
|
||||
import Annotation from '@loafer/core/annotation/Annotation';
|
||||
|
||||
export class MethodParameter {
|
||||
}
|
||||
|
||||
export default MethodParameter;
|
11
src/ts/@loafer/core/SimpleAliasRegistry.ts
Normal file
11
src/ts/@loafer/core/SimpleAliasRegistry.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import {
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
import AliasRegistry from '@loafer/core/AliasRegistry';
|
||||
|
||||
export class SimpleAliasRegistry implements AliasRegistry {
|
||||
}
|
||||
|
||||
export default SimpleAliasRegistry;
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
import {
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
import Environment from '@loafer/core/env/Environment';
|
||||
|
||||
export interface ConfigurableEnvironment extends Environment {
|
||||
setActiveProfiles(...profiles: string[]): void;
|
||||
addActiveProfiles(profile: string): void;
|
||||
setDefaultProfiles(...profiles: string[]): void;
|
||||
getSystemEnvironment(): Map<string, any>;
|
||||
getSystemProperties(): Map<string, any>;
|
||||
}
|
||||
|
||||
export default Environment;
|
||||
|
|
7
src/ts/@loafer/core/env/Environment.ts
vendored
7
src/ts/@loafer/core/env/Environment.ts
vendored
|
@ -1,9 +1,10 @@
|
|||
import {
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
import PropertyResolver from '@loafer/core/env/PropertyResolver';
|
||||
|
||||
export interface Environment extends PropertyResolver {
|
||||
getActiveProfiles(): string[];
|
||||
getDefaultProfiles(): string[];
|
||||
acceptsProfiles(...profiles: string[]): boolean;
|
||||
}
|
||||
|
||||
export default Environment;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import Environment from '@loafer/core/env/Environment';
|
||||
|
||||
export interface EnvironmentCapable {
|
||||
getEnvironment(): Environment;
|
||||
}
|
||||
|
||||
export default EnvironmentCapable;
|
||||
|
|
6
src/ts/@loafer/core/env/PropertyResolver.ts
vendored
6
src/ts/@loafer/core/env/PropertyResolver.ts
vendored
|
@ -1,6 +1,8 @@
|
|||
import {
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
export interface PropertyResolver {
|
||||
containsProperty(key: string): boolean;
|
||||
getProperty(key: string, defaultValue?: string): string;
|
||||
}
|
||||
|
||||
export default PropertyResolver;
|
||||
|
|
4
src/ts/@loafer/pouches/factory/DisposablePouch.ts
Normal file
4
src/ts/@loafer/pouches/factory/DisposablePouch.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
export interface DisposablePouch {
|
||||
}
|
||||
|
||||
export default DisposablePouch;
|
8
src/ts/@loafer/pouches/factory/FactoryPouch.ts
Normal file
8
src/ts/@loafer/pouches/factory/FactoryPouch.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import {
|
||||
ClassType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
export interface FactoryPouch<T> {
|
||||
}
|
||||
|
||||
export default FactoryPouch;
|
|
@ -1,7 +1,6 @@
|
|||
import PouchFactory from '@loafer/pouches/factory/PouchFactory';
|
||||
|
||||
export interface HierarchicalPouchFactory extends PouchFactory {
|
||||
getParentBeanFactory(): PouchFactory;
|
||||
}
|
||||
|
||||
export default HierarchicalPouchFactory;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import {
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
import PouchFactory from '@loafer/pouches/factory/PouchFactory';
|
||||
|
||||
export interface ListablePouchFactory extends PouchFactory {
|
||||
containsPouchDefinition(pouchName: string): boolean;
|
||||
getPouchDefinitionCount(): number;
|
||||
getPouchDefinitionNames(): string[];
|
||||
}
|
||||
|
||||
export default ListablePouchFactory;
|
||||
|
|
4
src/ts/@loafer/pouches/factory/ObjectFactory.ts
Normal file
4
src/ts/@loafer/pouches/factory/ObjectFactory.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
export interface ObjectFactory<T> {
|
||||
}
|
||||
|
||||
export default ObjectFactory;
|
|
@ -7,26 +7,8 @@ import {
|
|||
Class,
|
||||
} from '@loafer/core/reflect';
|
||||
|
||||
interface PouchFactory {
|
||||
/**
|
||||
* @param name is identity of pouch
|
||||
* @param type is type of pouch (if type is not specified, set the undefined)
|
||||
* @param args are argument of target constructor
|
||||
* @returns an instance of pouch
|
||||
*/
|
||||
getPouch(name: PropertyType, type: ClassType, ...args: any[]): any;
|
||||
/**
|
||||
* @param type is type of pouch
|
||||
* @param qualifier is identity of pouch (if qualifier is not specified, set the undefined)
|
||||
* @param args are argument of target constructor
|
||||
* @returns an instance of pouch
|
||||
*/
|
||||
getPouchByType(type: ClassType, ...args: any[]): any;
|
||||
export interface PouchFactory {
|
||||
|
||||
containsPouch(name: string): boolean;
|
||||
isSingleton(name: string): boolean;
|
||||
isTransient(name: string): boolean;
|
||||
getClass(name: string): Class;
|
||||
}
|
||||
|
||||
export default PouchFactory;
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import {
|
||||
ClassType,
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
import PouchFactory from '@loafer/pouches/factory/PouchFactory';
|
||||
import HierarchicalPouchFactory from '@loafer/pouches/factory/HierarchicalPouchFactory';
|
||||
import PouchDefinition from '@loafer/pouches/factory/config/PouchDefinition';
|
||||
import SingletonPouchRegistry from '@loafer/pouches/factory/config/SingletonPouchRegistry';
|
||||
import PouchExpressionResolver from '@loafer/pouches/factory/config/PouchExpressionResolver';
|
||||
|
||||
|
||||
|
||||
export interface ConfigurablePouchFactory extends HierarchicalPouchFactory, SingletonPouchRegistry {
|
||||
}
|
||||
|
||||
export default ConfigurablePouchFactory;
|
|
@ -5,16 +5,6 @@ import {
|
|||
import PouchFactory from '@loafer/pouches/factory/PouchFactory';
|
||||
|
||||
export interface InjectCapablePouchFactory extends PouchFactory {
|
||||
createPouch(type: ClassType, injectMode?: number, dependencyCheck?: boolean): any;
|
||||
injectPouch(existingPouch: any): void;
|
||||
configureBean(existingBean: any, pouchName: PropertyType): any;
|
||||
inject(type: ClassType, injectMode: number, dependencyCheck: boolean): any;
|
||||
injectPouchProperties(existingPouch: any, injectMode: number, dependencyCheck: boolean): void;
|
||||
applyPouchPropertyValues(existingPouch: any, pouchName: PropertyType): void;
|
||||
initializePouch?(existingPouch: any, pouchName: PropertyType): any;
|
||||
applyPouchPostProcessorsBeforeInitialization?(existingPouch: any, pouchName: PropertyType): any;
|
||||
applyPouchPostProcessorsAfterInitialization?(existingPouch: any, pouchName: PropertyType): any;
|
||||
destroyPouch(existingPouch: any): void;
|
||||
}
|
||||
|
||||
export default InjectCapablePouchFactory;
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
import {
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
import ConfigurablePouchFactory from '@loafer/pouches/factory/config/ConfigurablePouchFactory';
|
||||
import Scope from '@loafer/pouches/factory/config/Scope';
|
||||
|
||||
export class PouchExpressionContext {
|
||||
}
|
||||
|
||||
export default PouchExpressionContext;
|
|
@ -0,0 +1,11 @@
|
|||
import {
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
import PouchExpressionContext from '@loafer/pouches/factory/config/PouchExpressionContext';
|
||||
|
||||
export interface PouchExpressionResolver {
|
||||
|
||||
}
|
||||
|
||||
export default PouchExpressionResolver;
|
11
src/ts/@loafer/pouches/factory/config/Scope.ts
Normal file
11
src/ts/@loafer/pouches/factory/config/Scope.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import {
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
import ObjectFactory from '@loafer/pouches/factory/ObjectFactory';
|
||||
|
||||
export interface Scope {
|
||||
|
||||
}
|
||||
|
||||
export default Scope;
|
|
@ -1,14 +1,8 @@
|
|||
import {
|
||||
ClassType,
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
interface SingletonPouchRegistry {
|
||||
registerSingleton(pouch: any, qualifier?: PropertyType): void;
|
||||
getSingleton(qualifier: PropertyType, clazz?: ClassType): any;
|
||||
getSingletonByClass(clazz: ClassType, qualifier?: PropertyType): any;
|
||||
hasSingleton(qualifier: PropertyType, clazz?: ClassType): boolean;
|
||||
hasSingletonByClass(clazz: ClassType, qualifier?: PropertyType): boolean;
|
||||
export interface SingletonPouchRegistry {
|
||||
}
|
||||
|
||||
export default SingletonPouchRegistry;
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
import {
|
||||
ClassType,
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
import PouchDefinition from '@loafer/pouches/factory/config/PouchDefinition';
|
||||
|
||||
interface PouchDefinitionRegistry {
|
||||
registerPouchDefinition(pouchDefinition: PouchDefinition): void;
|
||||
|
||||
removePouchDefinition(qualifier: PropertyType, clazz?: ClassType): void;
|
||||
getPouchDefinition(qualifier: PropertyType, clazz?: ClassType): PouchDefinition;
|
||||
hasPouchDefinition(qualifier: PropertyType, clazz?: ClassType): boolean;
|
||||
|
||||
removePouchDefinitionByClass(clazz: ClassType, qualifier?: PropertyType): void;
|
||||
getPouchDefinitionByClass(clazz: ClassType, qualifier?: PropertyType): PouchDefinition;
|
||||
hasPouchDefinitionByClass(clazz: ClassType, qualifier?: PropertyType): boolean;
|
||||
}
|
||||
|
||||
export default PouchDefinitionRegistry;
|
|
@ -0,0 +1,7 @@
|
|||
import AliasRegistry from '@loafer/core/AliasRegistry';
|
||||
import PouchDefinition from '@loafer/pouches/factory/config/PouchDefinition';
|
||||
|
||||
export abstract class AbstractInjectCapablePouchFactory extends AliasRegistry {
|
||||
}
|
||||
|
||||
export default AbstractInjectCapablePouchFactory;
|
|
@ -0,0 +1,7 @@
|
|||
import AliasRegistry from '@loafer/core/AliasRegistry';
|
||||
import FactoryPouchRegistrySupport from '@loafer/pouches/factory/support/FactoryPouchRegistrySupport';
|
||||
|
||||
export abstract class AbstractPouchFactory extends FactoryPouchRegistrySupport {
|
||||
}
|
||||
|
||||
export default AbstractPouchFactory;
|
|
@ -0,0 +1,7 @@
|
|||
import AliasRegistry from '@loafer/core/AliasRegistry';
|
||||
import PouchDefinition from '@loafer/pouches/factory/config/PouchDefinition';
|
||||
|
||||
export class DefaultListablePouchFactory extends AliasRegistry {
|
||||
}
|
||||
|
||||
export default DefaultListablePouchFactory;
|
|
@ -0,0 +1,14 @@
|
|||
import {
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
import SimpleAliasRegistry from '@loafer/core/SimpleAliasRegistry';
|
||||
import ObjectFactory from '@loafer/pouches/factory/ObjectFactory';
|
||||
import DisposablePouch from '@loafer/pouches/factory/DisposablePouch';
|
||||
import PouchDefinition from '@loafer/pouches/factory/config/PouchDefinition';
|
||||
import SingletonPouchRegistry from '@loafer/pouches/factory/config/SingletonPouchRegistry';
|
||||
|
||||
export class DefaultSingletonPouchRegistry extends SimpleAliasRegistry implements SingletonPouchRegistry {
|
||||
}
|
||||
|
||||
export default DefaultSingletonPouchRegistry;
|
|
@ -0,0 +1,14 @@
|
|||
import {
|
||||
ClassType,
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
|
||||
import AliasRegistry from '@loafer/core/AliasRegistry';
|
||||
import FactoryPouch from '@loafer/pouches/factory/FactoryPouch';
|
||||
import DefaultSingletonPouchRegistry from '@loafer/pouches/factory/support/DefaultSingletonPouchRegistry';
|
||||
|
||||
export abstract class FactoryPouchRegistrySupport extends DefaultSingletonPouchRegistry {
|
||||
|
||||
}
|
||||
|
||||
export default FactoryPouchRegistrySupport;
|
|
@ -0,0 +1,10 @@
|
|||
import {
|
||||
PropertyType,
|
||||
} from '@loafer/core/constants/types';
|
||||
import AliasRegistry from '@loafer/core/AliasRegistry';
|
||||
import PouchDefinition from '@loafer/pouches/factory/config/PouchDefinition';
|
||||
|
||||
export interface PouchDefinitionRegistry extends AliasRegistry {
|
||||
}
|
||||
|
||||
export default AliasRegistry;
|
Loading…
Reference in New Issue
Block a user