public class TerminationMonitor
extends java.lang.Thread
| Modifier and Type | Field and Description |
|---|---|
protected int |
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 java.lang.String |
MSG_DUMP
Message template for dumping running threads.
|
protected static java.lang.String |
MSG_TERMINATION
Message template for forcing termination.
|
protected java.io.PrintStream |
output
Stream where to print thread dumps to.
|
| Constructor and Description |
|---|
TerminationMonitor(java.io.PrintStream output,
int threadDumpIntervalSeconds,
int systemExitSeconds) |
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprotected static final java.lang.String MSG_DUMP
protected static final java.lang.String MSG_TERMINATION
protected final int dumpIntervalSeconds
protected final int exitSeconds
protected final java.io.PrintStream output
public TerminationMonitor(java.io.PrintStream output,
int threadDumpIntervalSeconds,
int systemExitSeconds)
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.