Class TerminationMonitor
java.lang.Object
java.lang.Thread
de.aristaflow.adept2.core.registry.TerminationMonitor
- All Implemented Interfaces:
Runnable
Simple shutdown monitor, which allows for watching
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final longIn an interval of the given amount of seconds, the thread will perform an informational thread dump which allows to analyse the situation.protected final intIf a value > 0 is provided, the thread will use System.exit(1) to terminate the Java process.protected static final StringMessage template for dumping running threads.protected static final StringMessage template for forcing termination.protected final PrintStreamStream where to print thread dumps to.Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionTerminationMonitor(PrintStream output, int threadDumpIntervalSeconds, int systemExitSeconds) -
Method Summary
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Field Details
-
MSG_DUMP
Message template for dumping running threads.- See Also:
-
MSG_TERMINATION
Message template for forcing termination.- See Also:
-
dumpIntervalSeconds
protected final long dumpIntervalSecondsIn an interval of the given amount of seconds, the thread will perform an informational thread dump which allows to analyse the situation. -
exitSeconds
protected final int exitSecondsIf a value > 0 is provided, the thread will use System.exit(1) to terminate the Java process. -
output
Stream where to print thread dumps to.
-
-
Constructor Details
-
TerminationMonitor
- Parameters:
output- Stream where to print thread dumps to.threadDumpIntervalSeconds- In an interval of the given amount of seconds, the thread will perform an informational thread dump which allows to analyse the situation.systemExitSeconds- If a value > 0 is provided, the thread will use System.exit(1) to terminate the Java process.
-
-
Method Details