Package io.ktor.application
Types
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 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. |
Exceptions
class DuplicateApplicationFeatureException : Exception Thrown when Application Feature has been attempted to be installed with the same key as already installed Feature |
|
class MissingApplicationFeatureException : Thrown when Application Feature has been attempted to be accessed but has not been installed before |
Type Aliases
Specifies signature for the event handler |
Properties
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 PipelineContext<*, ApplicationCall>.application: Application Current application for the context |
|
val PipelineContext<*, ApplicationCall>.call: ApplicationCall Current call for the context |
|
val Application.log: Logger Convenience property to access log from application |
Functions
fun <A : Pipeline<*, ApplicationCall>, B : Any, F : Any> A.feature( 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( Returns feature instance for this pipeline, or null if feature is not installed |
|
fun <P : Pipeline<*, ApplicationCall>, B : Any, F : Any> P.install( Installs feature into this pipeline, if it is not yet installed |
|
fun <A : Pipeline<*, ApplicationCall>, B : Any, F : Any> A.uninstall( 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( Uninstalls feature specified by key from the pipeline |