diff --git a/core/pom.xml b/core/pom.xml index 8ee70efb49cf170461158100daab03f4c2021e5e..28bbb7044bff3d56ba2ae53c791359dca2ce4d6c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -596,7 +596,7 @@ THE SOFTWARE. org.jvnet.winp winp - 1.10 + 1.11 org.jvnet.hudson diff --git a/core/src/main/java/hudson/util/ProcessTree.java b/core/src/main/java/hudson/util/ProcessTree.java index 6f4bd2eb23e1714321517b0d36c4d9d18618474b..bc14679cd938261dba951248048740b999b98e12 100644 --- a/core/src/main/java/hudson/util/ProcessTree.java +++ b/core/src/main/java/hudson/util/ProcessTree.java @@ -77,7 +77,7 @@ public abstract class ProcessTree implements Iterable { /** * To be filled in the constructor of the derived type. */ - private final Map processes = new HashMap(); + protected final Map processes = new HashMap(); // instantiation only allowed for subtypes in this class private ProcessTree() {} @@ -158,11 +158,10 @@ public abstract class ProcessTree implements Iterable { return r; } - // TODO: pending new Winp -// /** -// * Kills this process. -// */ -// public abstract void kill(); + /** + * Kills this process. + */ + public abstract void kill(); /** * Kills this process and all the descendants. @@ -266,6 +265,10 @@ public abstract class ProcessTree implements Iterable { proc.destroy(); } + public void kill() { + proc.destroy(); + } + public List getArguments() { return Collections.emptyList(); } @@ -302,6 +305,10 @@ public abstract class ProcessTree implements Iterable { p.killRecursively(); } + public void kill() { + p.kill(); + } + @Override public synchronized List getArguments() { if(args==null) args = Arrays.asList(QuotedStringTokenizer.tokenize(p.getCommandLine()));