ApplicationChannel class Null safety

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.

Constructors

ApplicationChannel()

Properties

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

Methods

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.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
prepare() Future
You override this method to perform initialization tasks.
toString() String
A string representation of this object.
inherited
willStartReceivingRequests() → void
You override this method to perform initialization tasks that occur after entryPoint has been established.

Operators

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

Static Methods

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