Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
AgentShutdownHook(AgentMain agent)
Constructor for
AgentShutdownHook that retains the reference to the agent that will be shutdown when
the shutdown hook is triggered. |
| Modifier and Type | Method and Description |
|---|---|
List<Thread> |
interruptAllThreads()
We need to make sure our VM can die quickly, so this method will send interrupts
to most of the threads running in the VM to try to get them to hurry up and die.
|
void |
run()
This is executed when the VM is shutting down.
|
void |
spawnKillThread(long doomsday)
If something goes wrong and the VM does not die on its own when we think it should,
the thread created by this method will explicitly kill the VM.
|
int |
waitForNonDaemonThreads()
If you want the current agent to be dead this method will attept to wait for all
other non-daemon threads to die before returning.
|
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, yieldpublic AgentShutdownHook(AgentMain agent)
AgentShutdownHook that retains the reference to the agent that will be shutdown when
the shutdown hook is triggered.agent - the agent to be shutdown when shutdown hook is triggered.public void run()
public int waitForNonDaemonThreads()
public List<Thread> interruptAllThreads()
public void spawnKillThread(long doomsday)
doomsday - the number of milliseconds that the VM has left to live; once this
time expires, a kill thread will execute System.exit(0).Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.