|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.util.ProcessTreeKiller
ProcessTree
.
public final class ProcessTreeKiller
Kills a process tree to clean up the mess left by a build.
Constructor Summary | |
---|---|
ProcessTreeKiller()
Deprecated. |
Method Summary | |
---|---|
static EnvVars |
createCookie()
Deprecated. Use EnvVars.createCookie() |
static ProcessTreeKiller |
get()
Deprecated. Gets the ProcessTreeKiller suitable for the current system
that JVM runs in, or in the worst case return the default one
that's not capable of killing descendants at all. |
void |
kill(Map<String,String> modelEnvVars)
Deprecated. Use ProcessTree.killAll(Map) |
void |
kill(Process proc)
Deprecated. Use ProcessTree.OSProcess.killRecursively() |
void |
kill(Process proc,
Map<String,String> modelEnvVars)
Deprecated. Use ProcessTree.killAll(Map) and ProcessTree.OSProcess.killRecursively() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProcessTreeKiller()
Method Detail |
---|
public void kill(Process proc) throws InterruptedException
ProcessTree.OSProcess.killRecursively()
kill(proc,null)
InterruptedException
public void kill(Process proc, Map<String,String> modelEnvVars) throws InterruptedException
ProcessTree.killAll(Map)
and ProcessTree.OSProcess.killRecursively()
kill(Process)
does, also tries to
kill all the daemon processes launched.
Kills the given process (like Process.destroy()
but also attempts to kill descendant processes created from the given
process.
In addition, optionally perform "search and destroy" based on environment variables. In this method, the method is given a "model environment variables", which is a list of environment variables and their values that are characteristic to the launched process. The implementation is expected to find processes in the system that inherit these environment variables, and kill them all. This is suitable for locating daemon processes that cannot be tracked by the regular ancestor/descendant relationship.
The implementation is obviously OS-dependent.
proc
- Process to be killed recursively. Can be null.modelEnvVars
- If non-null, search-and-destroy will be performed.
InterruptedException
public void kill(Map<String,String> modelEnvVars) throws InterruptedException
ProcessTree.killAll(Map)
kill(null,modelEnvVars)
InterruptedException
public static EnvVars createCookie()
EnvVars.createCookie()
public static ProcessTreeKiller get()
ProcessTreeKiller
suitable for the current system
that JVM runs in, or in the worst case return the default one
that's not capable of killing descendants at all.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |