KtorServletService
class KtorServletService(port: Int, servletGroup: HttpServletGroup, initKtor: Application.() -> Unit = {}, initBlock: KtorServletService.() -> Unit = {}) : GenericIdleService
A Guava GenericIdleService that runs an embedded Ktor CIO server to host servlets from an HttpServletGroup.
Each servlet in the group is registered as a Ktor route. The service manages the Ktor server lifecycle, starting it on startUp and stopping it on shutDown.
Used by GenericKtorService for serving administrative endpoints (ping, version, health check, thread dump).
Parameters
port
The HTTP port for the Ktor server.
servletGroup
The HttpServletGroup containing servlets to register as routes.
initKtor
An optional Ktor Application configuration block applied before routing.
initBlock
An optional initialization block invoked after the service listener is registered.
Constructors
Link copied to clipboard
constructor(port: Int, servletGroup: HttpServletGroup, initKtor: Application.() -> Unit = {}, initBlock: KtorServletService.() -> Unit = {})