aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application/src
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-03-09 16:56:51 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-03-21 16:44:04 +0100
commit8a9738d1bebdb4584b40370fd45e43e898e29a15 (patch)
tree9a73916c31eb04f7b00229206007b5de8dad50f7 /sonar-application/src
parentd99053cb0b890c0e3bd054379a923bcf21ce0dd8 (diff)
downloadsonarqube-8a9738d1bebdb4584b40370fd45e43e898e29a15.tar.gz
sonarqube-8a9738d1bebdb4584b40370fd45e43e898e29a15.zip
SONAR-7435 SQ processes should have constant process ids
remove process id generation from JavaCommand
Diffstat (limited to 'sonar-application/src')
-rw-r--r--sonar-application/src/main/java/org/sonar/application/App.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/sonar-application/src/main/java/org/sonar/application/App.java b/sonar-application/src/main/java/org/sonar/application/App.java
index 1537405fa04..c66b5fade38 100644
--- a/sonar-application/src/main/java/org/sonar/application/App.java
+++ b/sonar-application/src/main/java/org/sonar/application/App.java
@@ -33,14 +33,19 @@ import org.sonar.process.monitor.JavaCommand;
import org.sonar.process.monitor.Monitor;
/**
- * Entry-point of process that starts and monitors elasticsearch and web servers
+ * Entry-point of process that starts and monitors ElasticSearch, the Web Server and the Compute Engine.
*/
public class App implements Stoppable {
+ public static final int APP_PROCESS_NUMBER = 0;
+ public static final int ES_PROCESS_INDEX = 1;
+ public static final int WEBSERVER_PROCESS_INDEX = 2;
+ public static final int CESERVER_PROCESS_INDEX = 3;
+
private final Monitor monitor;
public App(AppFileSystem appFileSystem, boolean watchForHardStop) {
- this(Monitor.create(appFileSystem, watchForHardStop));
+ this(Monitor.create(APP_PROCESS_NUMBER, appFileSystem, watchForHardStop));
}
App(Monitor monitor) {
@@ -67,7 +72,7 @@ public class App implements Stoppable {
}
private static JavaCommand createESCommand(Props props, File homeDir) {
- JavaCommand elasticsearch = new JavaCommand("search");
+ JavaCommand elasticsearch = new JavaCommand("search", ES_PROCESS_INDEX);
elasticsearch
.setWorkDir(homeDir)
.addJavaOptions("-Djava.awt.headless=true")
@@ -81,7 +86,7 @@ public class App implements Stoppable {
}
private static JavaCommand createWebServerCommand(Props props, File homeDir) {
- JavaCommand webServer = new JavaCommand("web")
+ JavaCommand webServer = new JavaCommand("web", WEBSERVER_PROCESS_INDEX)
.setWorkDir(homeDir)
.addJavaOptions(ProcessProperties.WEB_ENFORCED_JVM_ARGS)
.addJavaOptions(props.nonNullValue(ProcessProperties.WEB_JAVA_OPTS))
@@ -100,7 +105,7 @@ public class App implements Stoppable {
}
private static JavaCommand createCeServerCommand(Props props, File homeDir) {
- JavaCommand webServer = new JavaCommand("ce")
+ JavaCommand webServer = new JavaCommand("ce", CESERVER_PROCESS_INDEX)
.setWorkDir(homeDir)
.setClassName("org.sonar.ce.app.CeServer")
.setArguments(props.rawProperties())