Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NestApplicationContext

publicapi

Hierarchy

Implements

  • INestApplicationContext

Index

Constructors

constructor

Properties

Private _instanceLinksHost

_instanceLinksHost: InstanceLinksHost

Private Readonly activeShutdownSignals

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

Protected Readonly container

container: NestContainer

Private contextModule

contextModule: Module

Protected Readonly injector

injector: Injector = new Injector()

Protected isInitialized

isInitialized: boolean = false

Private Readonly scope

scope: Type<any>[]

Private Optional shutdownCleanupRef

shutdownCleanupRef: (...args: unknown[]) => unknown

Type declaration

    • (...args: unknown[]): unknown
    • Parameters

      • Rest ...args: unknown[]

      Returns unknown

Accessors

Private instanceLinksHost

Methods

Protected callBeforeShutdownHook

  • callBeforeShutdownHook(signal?: string): Promise<void>

Protected callBootstrapHook

  • callBootstrapHook(): Promise<void>

Protected callDestroyHook

  • callDestroyHook(): Promise<void>

Protected callInitHook

  • callInitHook(): Promise<void>

Protected callShutdownHook

  • callShutdownHook(signal?: string): Promise<void>

close

  • close(): Promise<void>

Protected dispose

  • dispose(): Promise<void>

enableShutdownHooks

  • Enables the usage of shutdown hooks. Will call the onApplicationShutdown function of a provider if the process receives a shutdown signal.

    Parameters

    Returns this

    The Nest application context instance

Protected find

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

get

  • get<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, options?: { strict: boolean }): TResult
  • Type parameters

    • TInput = any

    • TResult = TInput

    Parameters

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

    Returns TResult

init

  • init(): Promise<this>

Protected listenToShutdownSignals

  • listenToShutdownSignals(signals: string[]): void

registerRequestByContextId

  • registerRequestByContextId<T>(request: T, contextId: ContextId): void

resolve

  • resolve<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, contextId?: ContextId, options?: { strict: boolean }): Promise<TResult>
  • Type parameters

    • TInput = any

    • TResult = TInput

    Parameters

    • typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol
    • Default value contextId: ContextId = createContextId()
    • Default value options: { strict: boolean } = { strict: false }
      • strict: boolean

    Returns Promise<TResult>

Protected resolvePerContext

  • resolvePerContext<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, contextModule: Module, contextId: ContextId, options?: { strict: boolean }): Promise<TResult>
  • Type parameters

    • TInput = any

    • TResult = TInput

    Parameters

    • typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol
    • contextModule: Module
    • contextId: ContextId
    • Optional options: { strict: boolean }
      • strict: boolean

    Returns Promise<TResult>

select

  • select<T>(moduleType: Type<T>): INestApplicationContext

selectContextModule

  • selectContextModule(): void

Protected unsubscribeFromProcessSignals

  • unsubscribeFromProcessSignals(): void

useLogger

  • useLogger(logger: LoggerService | LogLevel[] | false): void

Generated using TypeDoc