diff options
author | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-07-22 18:17:35 +0200 |
---|---|---|
committer | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-07-23 15:34:06 +0200 |
commit | 94445f214582872ae49e26e675a5483fb2352807 (patch) | |
tree | 733383e811ab8e275bf99faad079a2caebe842d3 /server | |
parent | 67e04a3013976290743a682323c1ffe80672b069 (diff) | |
download | sonarqube-94445f214582872ae49e26e675a5483fb2352807.tar.gz sonarqube-94445f214582872ae49e26e675a5483fb2352807.zip |
SONAR-4898 - updated stop method for top level process
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java b/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java index d08163d56fd..b909bfe550a 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java +++ b/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java @@ -64,13 +64,11 @@ public class ProcessWrapper extends Thread { private File workDir; private File propertiesFile; private java.lang.Process process; - private volatile Thread processThread; private StreamGobbler errorGobbler; private StreamGobbler outputGobbler; private ProcessMXBean processMXBean; public ProcessWrapper(String processName) { - this.processThread = this; this.processName = processName; } @@ -163,10 +161,10 @@ public class ProcessWrapper extends Thread { } catch (InterruptedException e) { e.printStackTrace(); } finally { + process.destroy(); waitUntilFinish(outputGobbler); waitUntilFinish(errorGobbler); closeStreams(process); - ProcessWrapper.this.processThread = null; } LOGGER.trace("ProcessWrapper::run() END"); } @@ -179,12 +177,9 @@ public class ProcessWrapper extends Thread { return processMXBean; } - public Object getThread() { - return this.processThread; - } - private void waitUntilFinish(@Nullable Thread thread) { if (thread != null) { + //TODO kill after X amount of time (if process does not exit by itself). try { thread.join(); } catch (InterruptedException e) { |