提交 1bdbdbb3 编写于 作者: K kohsuke

added the simplest kill method

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@19440 71c3de6d-444a-0410-be80-ed276b4c234a
上级 d1a4bb7b
......@@ -596,7 +596,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jvnet.winp</groupId>
<artifactId>winp</artifactId>
<version>1.10</version>
<version>1.11</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson</groupId>
......
......@@ -77,7 +77,7 @@ public abstract class ProcessTree implements Iterable<OSProcess> {
/**
* To be filled in the constructor of the derived type.
*/
private final Map<Integer/*pid*/, OSProcess> processes = new HashMap<Integer, OSProcess>();
protected final Map<Integer/*pid*/, OSProcess> processes = new HashMap<Integer, OSProcess>();
// instantiation only allowed for subtypes in this class
private ProcessTree() {}
......@@ -158,11 +158,10 @@ public abstract class ProcessTree implements Iterable<OSProcess> {
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<OSProcess> {
proc.destroy();
}
public void kill() {
proc.destroy();
}
public List<String> getArguments() {
return Collections.emptyList();
}
......@@ -302,6 +305,10 @@ public abstract class ProcessTree implements Iterable<OSProcess> {
p.killRecursively();
}
public void kill() {
p.kill();
}
@Override
public synchronized List<String> getArguments() {
if(args==null) args = Arrays.asList(QuotedStringTokenizer.tokenize(p.getCommandLine()));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册