Skip to main content

Class: ApplicationFactory

Bootstraps and manages the full Aurora application lifecycle:

  • Scans modules and builds the DI graph
  • Instantiates controllers up front (to support lifecycle hooks)
  • Binds controller events to the platform driver via EventBinder

Use ApplicationFactory.create to initialize and obtain the application instance.

Methods

close()

close(signal?): Promise<void>

Shuts down the application and calls shutdown hooks.

Parameters

signal?

string

Returns

Promise<void>


get()

get<T>(token): Promise<T>

Resolves an instance from the DI container.

Type Parameters

T

T

Parameters

token

Token<T>

The provider token or class

Returns

Promise<T>


start()

start(): Promise<void>

Starts the application and binds all controller event handlers.

Returns

Promise<void>


create()

static create(rootModule, platformDriver): Promise<IApplication>

Bootstraps an Aurora application and returns its public interface.

Parameters

rootModule

Type

The application's root module (entry point)

platformDriver

IPlatformDriver

The platform driver for this runtime

Returns

Promise<IApplication>

A Promise resolving to the IApplication instance