ServletService

class ServletService(port: Int, servletGroup: ServletGroup, initBlock: ServletService.() -> Unit = {}) : GenericIdleService

A Guava GenericIdleService that runs an embedded Jetty server to host servlets from a ServletGroup.

Each servlet in the group is registered under the root context path (/). The service manages the Jetty server lifecycle, starting it on startUp and stopping it on shutDown.

Used by GenericService for serving administrative endpoints (ping, version, health check, thread dump).

Parameters

port

The HTTP port for the Jetty server.

servletGroup

The ServletGroup containing servlets to register.

initBlock

An optional initialization block invoked after the service listener is registered.

Constructors

Link copied to clipboard
constructor(port: Int, servletGroup: ServletGroup, initBlock: ServletService.() -> 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