ApplicationChannel class

An object that defines the behavior specific to your application.

You create a subclass of ApplicationChannel to initialize your application's services and define how HTTP requests are handled by your application. There must only be one subclass in an application and it must be visible to your application library file, e.g., 'package:my_app/my_app.dart'.

You must implement entryPoint to define the controllers that comprise your application channel. Most applications will also override prepare to read configuration values and initialize services. Some applications will provide an initializeApplication method to do global startup tasks.

When your application is started, an instance of your application channel is created for each isolate (see Application.start). Each instance is a replica of your application that runs in its own memory isolated thread.

Implemented types




entryPoint Controller
You implement this accessor to define how HTTP requests are handled by your application. [...]
logger Logger
The logger that this object will write messages to. [...]
messageHub ApplicationMessageHub
Use this object to send data to channels running on other isolates. [...]
options ApplicationOptions
The configuration options used to start the application this channel belongs to. [...]
read / write
securityContext → SecurityContext
The context used for setting up HTTPS in an application. [...]
server ApplicationServer
The ApplicationServer that sends HTTP requests to this object.
read / write
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited


close() → Future
You override this method to release any resources created in prepare. [...]
documentAPI(Map<String, dynamic> projectSpec) → Future<APIDocument>
Creates an OpenAPI document for the components and paths in this channel. [...]
documentComponents(APIDocumentContext registry) → void
Tells this object to add its components to context. [...]
@mustCallSuper, override
prepare() → Future
You override this method to perform initialization tasks. [...]
willStartReceivingRequests() → void
You override this method to perform initialization tasks that occur after entryPoint has been established. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toString() → String
Returns a string representation of this object.


operator ==(dynamic other) → bool
The equality operator.

Static Properties

defaultType → Type
Returns the subclass of ApplicationChannel found in an application library.

Static Methods

initializeApplication(ApplicationOptions options) → Future
You implement this method to provide global initialization for your application. [...]