Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MidwayContainer

Hierarchy

Implements

Constructors

constructor

Properties

Protected aspectService

aspectService: any

baseDir

baseDir: string = null

Protected configService

configService: IConfigService

disableConflictCheck

disableConflictCheck: boolean = false

Protected environmentService

environmentService: IEnvironmentService

id

id: string

Protected informationService

informationService: IInformationService

messageSource

messageSource: IMessageSource = null

Protected midwayIdentifiers

midwayIdentifiers: string[] = []

parent

parent: IApplicationContext = null

Protected readied

readied: boolean = false

Protected resolverHandler

resolverHandler: ResolverHandler

Static parentApplicationContext

parentApplicationContext: IMidwayContainer

单进程中上一次的 applicationContext

Static parentDefinitionMetadata

parentDefinitionMetadata: Map<string, IObjectDefinitionMetadata[]>

单个进程中上一次的 applicationContext 的 registry

Accessors

dependencyMap

isReady

  • get isReady(): boolean

props

registry

Methods

addConfiguration

addDirectoryFilter

  • addDirectoryFilter(directoryFilter: any): void

afterEachCreated

  • afterEachCreated(fn: function): void

beforeEachCreated

  • beforeEachCreated(fn: function): void

bind

  • bind<T>(target: T, options?: ObjectDefinitionOptions): void
  • bind<T>(identifier: ObjectIdentifier, target: T, options?: ObjectDefinitionOptions): void

bindClass

  • bindClass(exports: any, namespace?: string, filePath?: string): void

Protected bindModule

  • bindModule(module: any, namespace?: string, filePath?: string): void

containsConfiguration

  • containsConfiguration(namespace: string): boolean

createChild

createConfiguration

Protected createContainerIdx

  • createContainerIdx(): number

Protected createObjectDependencyTree

  • createObjectDependencyTree(identifier: any, definition: any): void

get

  • get<T>(identifier: any, args?: any): T

getAspectService

  • getAspectService(): any

getAsync

  • getAsync<T>(identifier: any, args?: any): Promise<T>

getConfigService

getCurrentEnv

  • getCurrentEnv(): string

Protected getCurrentNamespace

  • getCurrentNamespace(): string

Protected getDefinitionMetaList

  • getDefinitionMetaList(): any[]

getEnvironmentService

Protected getIdentifier

  • getIdentifier(target: any): string

getInformationService

Protected getManagedResolverFactory

getResolverHandler

init

  • init(): void

initService

  • initService(): void

isAsync

load

  • load(opts?: object): void
  • load directory and traverse file to find bind class

    Parameters

    • Default value opts: object = { loadDir: [] }
      • Optional ignore?: string | string[]
      • loadDir: string | string[]
      • Optional pattern?: string | string[]

    Returns void

loadDefinitions

  • loadDefinitions(): void

loadDirectory

  • loadDirectory(opts: object): void

ready

  • ready(): Promise<void>

registerCustomBinding

  • registerCustomBinding(objectDefinition: any, target: any): void

registerDataHandler

  • registerDataHandler(handlerType: string, handler: function): void

registerDefinition

registerObject

resolve

  • resolve<T>(target: T): T

Protected restoreDefinition

Protected restoreDefinitions

  • restoreDefinitions(definitionMetadataList: any): void

setInformationService

  • setInformationService(informationService: any): void

stop

  • stop(): Promise<void>

Generated using TypeDoc