Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NestApplicationContext

Hierarchy

Implements

  • any

Index

Constructors

constructor

Properties

Private activeShutdownSignals

activeShutdownSignals: string[] = new Array<string>()

Protected container

container: NestContainer

Private containerScanner

containerScanner: ContainerScanner

Private contextModule

contextModule: Module

Private moduleTokenFactory

moduleTokenFactory: ModuleTokenFactory = new ModuleTokenFactory()

Private scope

scope: Type<any>[]

Methods

Protected callBootstrapHook

  • callBootstrapHook(): Promise<void>

Protected callDestroyHook

  • callDestroyHook(): Promise<void>

Protected callInitHook

  • callInitHook(): Promise<void>

Protected callShutdownHook

  • callShutdownHook(signal?: string): Promise<void>
  • Calls the onApplicationShutdown function on the registered modules and children.

    Parameters

    • Optional signal: string

    Returns Promise<void>

close

  • close(): Promise<void>

enableShutdownHooks

  • enableShutdownHooks(signals?: any[]): this
  • Enables the usage of shutdown hooks. Will call the onApplicationShutdown function of a provider if the process receives a shutdown signal.

    Parameters

    • Default value signals: any[] = []

    Returns this

    The Nest application context instance

Protected find

  • find<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol): TResult

Protected findInstanceByPrototypeOrToken

  • findInstanceByPrototypeOrToken<TInput, TResult>(metatypeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, contextModule: Partial<Module>): TResult

get

  • get<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, options?: object): TResult
  • Type parameters

    • TInput

    • TResult

    Parameters

    • typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol
    • Default value options: object = { strict: false }
      • strict: boolean

    Returns TResult

init

  • init(): Promise<this>

Protected listenToShutdownSignals

  • listenToShutdownSignals(signals: string[]): void
  • Listens to shutdown signals by listening to process events

    Parameters

    • signals: string[]

      The system signals it should listen to

    Returns void

select

selectContextModule

  • selectContextModule(): void

useLogger

Generated using TypeDoc