AbstractGenericService

Shared base class for GenericService and GenericKtorService.

Holds the parts that are identical between the Jetty- and Ktor-hosted variants:

  • Prometheus metrics: JVM and application metrics exported via MetricsService

  • Zipkin tracing: distributed trace reporting via ZipkinReporterService

  • Health checks: Dropwizard health check registry with thread deadlock and service state monitoring

  • Service lifecycle: coordinated startup/shutdown of all sub-services via a Guava ServiceManager

Subclasses supply only the embedded server used to host the admin servlets — exposing it through servletServiceOrNull — and call initMetricsAndHealthChecks from their own init method once that servlet service has been constructed.

Parameters

configVals

The application-specific configuration values.

adminConfig

Configuration for admin endpoints.

metricsConfig

Configuration for Prometheus metrics.

zipkinConfig

Configuration for Zipkin tracing.

isTestMode

Whether the service is running in test mode.

Type Parameters

T

The type of the configuration values object.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Whether admin endpoints are enabled, based on AdminConfig.enabled.

Link copied to clipboard

Whether Prometheus metrics collection is enabled, based on MetricsConfig.enabled.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Whether Zipkin distributed tracing is enabled, based on ZipkinConfig.enabled.

Link copied to clipboard
lateinit var jmxReporter: JmxReporter

The JMX reporter for Dropwizard metrics. Initialized when metrics are enabled.

Link copied to clipboard

The Prometheus metrics service. Initialized when metrics are enabled.

Link copied to clipboard

The elapsed time since the service was created.

Link copied to clipboard

The Zipkin span reporter service. Initialized when Zipkin tracing is enabled.

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
open override fun close()
Link copied to clipboard
Link copied to clipboard
@CanIgnoreReturnValue
fun startAsync(): Service?
Link copied to clipboard
fun startSync(timeout: Duration)
Link copied to clipboard
fun state(): Service.State?
Link copied to clipboard
@CanIgnoreReturnValue
fun stopAsync(): Service?
Link copied to clipboard
fun stopSync(timeout: Duration)