ktor-server-host-common / io.ktor.server.engine / ApplicationEngineEnvironmentReloading

ApplicationEngineEnvironmentReloading

class ApplicationEngineEnvironmentReloading : ApplicationEngineEnvironment

Implements ApplicationEngineEnvironment by loading an Application from a folder or jar.

watchPaths specifies substrings to match against class path entries to monitor changes in folder/jar and implements hot reloading

Constructors

<init>

ApplicationEngineEnvironmentReloading(classLoader: ClassLoader, log: Logger, config: ApplicationConfig, connectors: List<EngineConnectorConfig>, modules: List<Application.() -> Unit>, watchPaths: List<String> = emptyList(), parentCoroutineContext: <ERROR CLASS> = EmptyCoroutineContext, rootPath: String = "")ApplicationEngineEnvironmentReloading(classLoader: ClassLoader, log: Logger, config: ApplicationConfig, connectors: List<EngineConnectorConfig>, modules: List<Application.() -> Unit>, watchPaths: List<String> = emptyList(), parentCoroutineContext: <ERROR CLASS> = EmptyCoroutineContext, rootPath: String = "", developmentMode: Boolean = true)

Implements ApplicationEngineEnvironment by loading an Application from a folder or jar.

Properties

application

val application: Application

Running Application.

classLoader

val classLoader: ClassLoader

config

val config: ApplicationConfig

connectors

val connectors: List<EngineConnectorConfig>

Connectors that describers where and how server should listen.

developmentMode

val developmentMode: Boolean

log

val log: Logger

monitor

val monitor: ApplicationEvents

parentCoroutineContext

val parentCoroutineContext: <ERROR CLASS>

rootPath

val rootPath: String

Functions

reload

fun reload(): Unit

Reload application: destroy it first and then create again

start

fun start(): Unit

Starts ApplicationEngineEnvironment and creates an application.

stop

fun stop(): Unit

Stops ApplicationEngineEnvironment and destroys any running application.