Class TerminationMonitor
- java.lang.Object
-
- java.lang.Thread
-
- de.aristaflow.adept2.core.registry.TerminationMonitor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected long
dumpIntervalSeconds
In an interval of the given amount of seconds, the thread will perform an informational thread dump which allows to analyse the situation.protected int
exitSeconds
If a value > 0 is provided, the thread will use System.exit(1) to terminate the Java process.protected static String
MSG_DUMP
Message template for dumping running threads.protected static String
MSG_TERMINATION
Message template for forcing termination.protected PrintStream
output
Stream where to print thread dumps to.-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description TerminationMonitor(PrintStream output, int threadDumpIntervalSeconds, int systemExitSeconds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run()
-
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 Detail
-
MSG_DUMP
protected static final String MSG_DUMP
Message template for dumping running threads.- See Also:
- Constant Field Values
-
MSG_TERMINATION
protected static final String MSG_TERMINATION
Message template for forcing termination.- See Also:
- Constant Field Values
-
dumpIntervalSeconds
protected final long dumpIntervalSeconds
In 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 exitSeconds
If a value > 0 is provided, the thread will use System.exit(1) to terminate the Java process.
-
output
protected final PrintStream output
Stream where to print thread dumps to.
-
-
Constructor Detail
-
TerminationMonitor
public TerminationMonitor(PrintStream output, int threadDumpIntervalSeconds, int systemExitSeconds)
- 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.
-
-