ApplicationChannel class abstract
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
Properties
- entryPoint → Controller
-
You implement this accessor to define how HTTP requests are handled by your application.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- logger → Logger
-
The logger that this object will write messages to.
no setter
- 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.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- securityContext → SecurityContext?
-
The context used for setting up HTTPS in an application.
no setter
- server ↔ ApplicationServer
-
The ApplicationServer that sends HTTP requests to this object.
getter/setter pair
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 nonexistent 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.