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 = {})

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun addListener(listener: Service.Listener?, executor: Executor?)
Link copied to clipboard
fun awaitRunning(timeout: Duration?)
fun awaitRunning(timeout: Long, unit: TimeUnit?)
Link copied to clipboard
fun awaitTerminated(timeout: Duration?)
fun awaitTerminated(timeout: Long, unit: TimeUnit?)
Link copied to clipboard
Link copied to clipboard
@CanIgnoreReturnValue
fun startAsync(): Service?
Link copied to clipboard
fun startSync(maxWait: Duration)
Link copied to clipboard
fun state(): Service.State?
Link copied to clipboard
@CanIgnoreReturnValue
fun stopAsync(): Service?
Link copied to clipboard
fun stopSync(maxWait: Duration)
Link copied to clipboard
open override fun toString(): String