aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application/src/main
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-07-23 11:37:35 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-07-23 15:34:07 +0200
commitcf4a25947f7812927f22c0c2cf2cd1bf8a58718c (patch)
tree83f3295cfa6096b630727f04064756804722c187 /sonar-application/src/main
parent1956e1b379399f6c689ef3fcb6072ad683c6e26e (diff)
downloadsonarqube-cf4a25947f7812927f22c0c2cf2cd1bf8a58718c.tar.gz
sonarqube-cf4a25947f7812927f22c0c2cf2cd1bf8a58718c.zip
SONAR-4898 - Updated logging for top level and cleaned termination
Diffstat (limited to 'sonar-application/src/main')
-rw-r--r--sonar-application/src/main/java/org/sonar/application/StartServer.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/sonar-application/src/main/java/org/sonar/application/StartServer.java b/sonar-application/src/main/java/org/sonar/application/StartServer.java
index 822ff487e0d..d7a8a89aaa5 100644
--- a/sonar-application/src/main/java/org/sonar/application/StartServer.java
+++ b/sonar-application/src/main/java/org/sonar/application/StartServer.java
@@ -19,6 +19,8 @@
*/
package org.sonar.application;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sonar.process.Monitor;
import org.sonar.process.NetworkUtils;
import org.sonar.process.ProcessWrapper;
@@ -30,13 +32,17 @@ public class StartServer {
private ProcessWrapper elasticsearch;
private ProcessWrapper server;
+ private static Logger LOGGER = LoggerFactory.getLogger(StartServer.class);
+
public StartServer() throws Exception {
Installation installation = new Installation();
Thread shutdownHook = new Thread(new Runnable() {
@Override
public void run() {
+ LOGGER.info("JVM Shutdown start");
stop();
+ LOGGER.info("JVM Shutdown end");
}
});
Runtime.getRuntime().addShutdownHook(shutdownHook);
@@ -86,12 +92,20 @@ public class StartServer {
}
public void stop() {
+ LOGGER.debug("StartServer::stop() START");
if (monitor != null) {
+ LOGGER.trace("StartServer::stop() STOP MONITOR");
monitor.interrupt();
+ monitor = null;
+
+ LOGGER.trace("StartServer::stop() STOP ES");
terminateAndWait(elasticsearch);
+
+ LOGGER.trace("StartServer::stop() STOP SQ");
terminateAndWait(server);
- monitor = null;
}
+ LOGGER.trace("StartServer::stop() END");
+
}
private void terminateAndWait(@Nullable ProcessWrapper process) {