class Application : ApplicationCallPipeline, CoroutineScope
Represents configured and running web application, capable of handling requests. It is also the application coroutine scope that is cancelled immediately at application stop so useful for launching background coroutines. |
|
interface ApplicationCall
Represents a single act of communication between client and server. |
|
open class ApplicationCallPipeline : Pipeline<Unit, ApplicationCall>
Pipeline configuration for executing ApplicationCall instances |
|
interface ApplicationEnvironment
Represents an environment in which Application runs |
|
class ApplicationEvents
Provides events for Application lifecycle |
|
interface ApplicationFeature<in TPipeline : Pipeline<*, ApplicationCall>, out TConfiguration : Any, TFeature : Any>
Defines an installable Application Feature |
|
open class EventDefinition<T>
Definition of an event. Event is used as a key so both hashCode and equals need to be implemented properly. Inheriting of this class is an experimental feature. Instantiate directly if inheritance not necessary. |
class DuplicateApplicationFeatureException : Exception
Thrown when Application Feature has been attempted to be installed with the same key as already installed Feature |
|
class MissingApplicationFeatureException : IllegalStateException, CopyableThrowable<MissingApplicationFeatureException>
Thrown when Application Feature has been attempted to be accessed but has not been installed before |
typealias EventHandler<T> = (T) -> Unit
Specifies signature for the event handler |
val ApplicationStarted: EventDefinition<Application>
Event definition for Application Started event |
|
val ApplicationStarting: EventDefinition<Application>
Event definition for Application Starting event |
|
val ApplicationStopPreparing: EventDefinition<ApplicationEnvironment>
Event definition for an event that is fired when the application is going to stop |
|
val ApplicationStopped: EventDefinition<Application>
Event definition for Application Stopped event |
|
val ApplicationStopping: EventDefinition<Application>
Event definition for Application Stopping event |
|
val Application.log: Logger
Convenience property to access log from application |
fun <A : Pipeline<*, ApplicationCall>, B : Any, F : Any> A.feature(feature: ApplicationFeature<A, B, F>): F
Gets feature instance for this pipeline, or fails with MissingApplicationFeatureException if the feature is not installed |
|
fun <A : Pipeline<*, ApplicationCall>, B : Any, F : Any> A.featureOrNull(feature: ApplicationFeature<A, B, F>): F?
Returns feature instance for this pipeline, or null if feature is not installed |
|
fun <P : Pipeline<*, ApplicationCall>, B : Any, F : Any> P.install(feature: ApplicationFeature<P, B, F>, configure: B.() -> Unit = {}): F
Installs feature into this pipeline, if it is not yet installed |
|
fun <A : Pipeline<*, ApplicationCall>, B : Any, F : Any> A.uninstall(feature: ApplicationFeature<A, B, F>): Unit
Uninstalls feature from the pipeline |
|
fun <A : Pipeline<*, ApplicationCall>> A.uninstallAllFeatures(): Unit
Uninstalls all features from the pipeline |
|
fun <A : Pipeline<*, ApplicationCall>, F : Any> A.uninstallFeature(key: AttributeKey<F>): Unit
Uninstalls feature specified by key from the pipeline |