Application class final

The application: owns the container, configuration, router and kernel (BLUEPRINT_V2 §7.1.2, §5.3).

Properties

basePath → String
Project root used to locate .env, database/, storage/.
final
booted → bool
Whether boot has completed.
no setter
config ↔ ConfigRepository
latefinal
container → Container
final
coordinator ↔ CoordinatorChannel?
Channel to the process coordinator (process-scope rate limits, locks, cache). Set by the Supervisor before boot; in-process otherwise.
getter/setter pair
draining → bool
Whether the server is shutting down (health endpoint answers 503).
no setter
drainSignal → DrainSignal
Completes when this application starts draining (long-lived responses such as server-sent events end on it).
final
engine → ServerEngine?
The running server engine, if any.
no setter
env ↔ Env
latefinal
exceptions → ExceptionHandler
final
hashCode → int
The hash code for this object.
no setterinherited
healthChecker → HealthChecker
The configured readiness checks.
no setter
healthPath → String?
The liveness probe path (withRouting(health: ...), /up by default); null when the probes are turned off.
no setter
kernel ↔ HttpKernel
latefinal
logger ↔ Logger
latefinal
middleware → MiddlewareRegistry
final
router → Router
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

boot() → Future<void>
Boots the application exactly once (safe to call concurrently). Boot runs with this container as Container.current, so facades work in providers, bindings and routing callbacks.
handle(Request request, {FutureOr<void> prepare()?}) → Future<Response>
Handles one request inside a fresh request scope (used by the server engine and the test client). prepare runs inside the request scope before the kernel (the test client uses it for actingAs).
markDraining() → void
Marks the application as draining; /up answers 503 from now on.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run<R>(FutureOr<R> body(), {String scope = 'command'}) → Future<R>
Runs body inside a scope named scope with this application's container active (commands, tests, scripts).
scheduler({ScheduleCommandRunner? commandRunner}) → Scheduler
A scheduler over the registered Schedule (schedule:run/work).
serve({ServeOptions? options, void onStarted(ServerEngine engine)?}) → Future<void>
Boots, serves HTTP until the engine stops, then releases resources. onStarted fires once the socket is bound (used by workers to report readiness).
shutdown() → Future<void>
Stops the server (if running) and releases resources.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

configure({String? basePath}) → ApplicationBuilder
Starts fluent configuration (Application.configure(basePath: ...)).
serveWith(ApplicationFactory factory, {String? host, int? port, int? isolates, bool? embedQueue, bool? embedScheduler, int? maxInFlight, Duration? maxQueueDelay, ScheduleCommandRunner? commandRunner, int? processes, List<String> childArguments = const <String>[]}) → Future<int>
Serves with factory: in-process when isolates <= 1, otherwise a Supervisor spawns isolates workers that each build their own application. Returns the process exit code.