Options
All
  • Public
  • Public/Protected
  • All
Menu

The main application container.

Hierarchy

Index

Constructors

constructor

Properties

Protected applicationUnits

applicationUnits: typeof Unit[] = []

The Unit classes registered with the app.

Protected baseDir

baseDir: string

The fully-qualified path to the base directory of the app.

Protected basePath

basePath: UniversalPath

Resolved universal path to the base directory of the app.

Protected factories

factories: Collection<AbstractFactory<unknown>> = ...

Collection of factories registered with this container.

forceStartupMessage

forceStartupMessage: boolean = true

If true, the "Starting Extollo..." messages will always be logged.

Protected instances

instances: Collection<InstanceRef> = ...

Collection of singleton instances produced by this container.

Protected instantiatedUnits

instantiatedUnits: Unit[] = []

Instances of the units registered with this app.

Static Readonly NODE_MODULES_INJECTION

NODE_MODULES_INJECTION: "extollo/npm" = 'extollo/npm'

Accessors

appRoot

errorHandler

  • get errorHandler(): (e: Error) => void
  • Get an instance of the RunLevelErrorHandler.

    Returns (e: Error) => void

      • (e: Error): void
      • Parameters

        • e: Error

        Returns void

root

Static NODE_MODULES_PROVIDER

  • get NODE_MODULES_PROVIDER(): string

Methods

appPath

Protected bootstrapEnvironment

  • bootstrapEnvironment(): void

cloneTo

down

  • down(): Promise<void>

env

  • env(key: string, defaultValue?: unknown): any
  • Get a value from the loaded environment variables. If no value could be found, the default value will be returned.

    Parameters

    • key: string
    • Optional defaultValue: unknown

    Returns any

errorWrapContext

getDependencies

getExistingInstance

  • getExistingInstance(key: any): any

hasInstance

  • hasInstance(key: any): boolean

hasKey

  • hasKey(key: any): boolean

hasUnit

  • hasUnit(unitClass: typeof Unit): boolean

make

  • make<T>(target: any, ...parameters: any[]): T
  • Create an instance of the given target. The target can either be a DependencyKey registered with this container (in which case, the singleton value will be returned), or an instantiable class.

    If the instantiable class has the Injectable decorator, its injectable parameters will be automatically injected into the instance.

    Type parameters

    • T

    Parameters

    • target: any
    • Rest ...parameters: any[]

    Returns T

path

Protected produceFactory

purge

register

registerFactory

registerNamed

registerProducer

  • registerProducer(name: any, producer: () => any): Application
  • Register the given function as a factory within the container.

    Parameters

    • name: any

      unique name to identify the factory in the container

    • producer: () => any

      factory to produce a value

        • (): any
        • Returns any

    Returns Application

registerSingleton

  • registerSingleton<T>(key: any, value: T): Application
  • Register a value as a singleton in the container. It will not be instantiated, but can be injected by its unique name.

    Type parameters

    • T

    Parameters

    • key: any

      unique name to identify the singleton in the container

    • value: T

    Returns Application

registerSingletonInstance

  • registerSingletonInstance<T>(staticClass: any, instance: T): Application

release

resolve

resolveAndCreate

  • resolveAndCreate(key: any, ...parameters: any[]): any
  • Resolve the dependency key. If a singleton value for that key already exists in this container, return that value. Otherwise, use the factory an given parameters to produce and return the value.

    Parameters

    • key: any
    • Rest ...parameters: any[]

    Returns any

run

  • run(): Promise<void>

scaffold

  • scaffold(absolutePathToApplicationRoot: string, applicationUnits: typeof Unit[]): void
  • Set up the bare essentials to get the application up and running.

    Parameters

    • absolutePathToApplicationRoot: string
    • applicationUnits: typeof Unit[]

    Returns void

Protected setupLogging

  • setupLogging(): void

startUnit

  • startUnit(unit: Unit): Promise<void>

stopUnit

  • stopUnit(unit: Unit): Promise<void>

up

  • up(): Promise<void>

Static getApplication

Static getContainer

Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.