GenericIdleService

abstract class GenericIdleService : AbstractIdleService

Abstract base class that wraps Guava's AbstractIdleService with Kotlin Duration-based synchronous start and stop methods.

Constructors

Link copied to clipboard
constructor()

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

Creates a Service.Listener for this Service that logs all lifecycle transitions (starting, running, stopping, terminated, failed) using the provided logger.

Link copied to clipboard
@CanIgnoreReturnValue
fun startAsync(): Service?
Link copied to clipboard
fun startSync(timeout: Duration)

Starts the service and blocks until it is running, for Java callers: the overload taking a Kotlin Duration is compiled under a mangled name that Java cannot call.

fun startSync(timeout: Duration = 30.seconds)

Starts the service asynchronously and blocks until it is running.

Link copied to clipboard
fun state(): Service.State?
Link copied to clipboard
@CanIgnoreReturnValue
fun stopAsync(): Service?
Link copied to clipboard
fun stopSync(timeout: Duration)

Stops the service and blocks until it has terminated, for Java callers; see the java.time.Duration startSync.

fun stopSync(timeout: Duration = 30.seconds)

Stops the service asynchronously and blocks until it has terminated.