ShutdownableThread

ShutdownableThread is the contract for non-daemon threads of execution.

ShutdownableThread contract expects that the objects implement doWork method.

def doWork(): Unit
Table 1. ShutdownableThread’s Internal Properties (e.g. Registries and Counters)
Name Description

isRunning

Flag that controls how long to execute run method.

shutdownLatch

Java’s java.util.concurrentCountDownLatch with the number of passes being 1

run Method

run(): Unit
Note
run is a part of java.lang.Runnable that is executed when the thread is started.

run first prints out the following INFO message to the logs:

Starting

run then executes doWork method until isRunning flag is disabled.

In the end, run decrements the count of shutdownLatch and prints out the following INFO message to the logs:

Stopped

results matching ""

    No results matching ""