abstract class BaseApplicationEngine : ApplicationEngine
Base class for implementing ApplicationEngine
It creates default engine pipeline, provides application property and installs default transformations on respond and receive
environment
- instance of ApplicationEngineEnvironment for this engine
pipeline
- pipeline to use with this engine
open class Configuration : Configuration
Configuration for the BaseApplicationEngine |
BaseApplicationEngine(environment: ApplicationEngineEnvironment, pipeline: EnginePipeline = defaultEnginePipeline(environment))
Base class for implementing ApplicationEngine |
val environment: ApplicationEngineEnvironment
instance of ApplicationEngineEnvironment for this engine |
|
val pipeline: EnginePipeline
pipeline to use with this engine |
open val application: Application
Currently running application instance |
abstract fun start(wait: Boolean = false): ApplicationEngine
Starts this ApplicationEngine |
|
open fun abstract fun stop(gracePeriodMillis: Long, timeoutMillis: Long): Unit
Stops this ApplicationEngine |
fun ApplicationEngine.addShutdownHook(stop: () -> Unit): Unit
Adds automatic JVM shutdown hooks management. Should be used before starting the engine. Once JVM termination noticed, stop block will be executed. Please note that a shutdown hook only registered when the application is running. If the application is already stopped then there will be no hook and no stop function invocation possible. So stop block will be called once or never. |
|
fun ApplicationEngine.stop(gracePeriod: Long, timeout: Long, timeUnit: TimeUnit): Unit
Stops this ApplicationEngine |
|
fun ApplicationEngine.stopServerOnCancellation(): CompletableJob
Stop server on job cancellation. The returned deferred need to be completed or cancelled. |