hudson.util
Class ProcessTreeKiller

java.lang.Object
  extended by hudson.util.ProcessTreeKiller

Deprecated. as of 1.315. Use ProcessTree.

public final class ProcessTreeKiller
extends Object

Kills a process tree to clean up the mess left by a build.

Since:
1.201
Author:
Kohsuke Kawaguchi

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

ProcessTreeKiller

public ProcessTreeKiller()
Deprecated. 
Method Detail

kill

public void kill(Process proc)
          throws InterruptedException
Deprecated. Use ProcessTree.OSProcess.killRecursively()

Short for kill(proc,null)

Throws:
InterruptedException

kill

public void kill(Process proc,
                 Map<String,String> modelEnvVars)
          throws InterruptedException
Deprecated. Use ProcessTree.killAll(Map) and ProcessTree.OSProcess.killRecursively()

In addition to what 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.

Parameters:
proc - Process to be killed recursively. Can be null.
modelEnvVars - If non-null, search-and-destroy will be performed.
Throws:
InterruptedException

kill

public void kill(Map<String,String> modelEnvVars)
          throws InterruptedException
Deprecated. Use ProcessTree.killAll(Map)

Short for kill(null,modelEnvVars)

Throws:
InterruptedException

createCookie

public static EnvVars createCookie()
Deprecated. Use EnvVars.createCookie()

Creates a magic cookie that can be used as the model environment variable when we later kill the processes.


get

public 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.



Copyright © 2004-2013. All Rights Reserved.