aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application/src/main/java/org/sonar/application
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-02-21 14:51:34 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-02-24 21:08:18 +0100
commit679db32dc10eebf6e7d8cfddc44aa719696485ed (patch)
tree94b3022c04611200761432d6ab45d56584702044 /sonar-application/src/main/java/org/sonar/application
parentf4b7d2d78416ba858d2c2f7998f3c320c95ad1e4 (diff)
downloadsonarqube-679db32dc10eebf6e7d8cfddc44aa719696485ed.tar.gz
sonarqube-679db32dc10eebf6e7d8cfddc44aa719696485ed.zip
SONAR-8435 log "SonarQube is up" if all processes are operational
which implies: 1/ to distinguish from Monitored#getStatus() = UP and OPERATIONAL 2/ to have an option of Monitor to wait on process's status to be OPERATIONAL 3/ every Monitored implementation must return OPERATIONAL rather than UP if then don't make a distinction between the two
Diffstat (limited to 'sonar-application/src/main/java/org/sonar/application')
-rw-r--r--sonar-application/src/main/java/org/sonar/application/App.java10
1 files changed, 8 insertions, 2 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 dd9ae03fcae..a2e96cbd3ab 100644
--- a/sonar-application/src/main/java/org/sonar/application/App.java
+++ b/sonar-application/src/main/java/org/sonar/application/App.java
@@ -62,7 +62,13 @@ public class App implements Stoppable {
private final Monitor monitor;
public App(AppFileSystem appFileSystem, boolean watchForHardStop) {
- this(Monitor.create(APP.getIpcIndex(), appFileSystem, watchForHardStop, new AppLifecycleListener()));
+ this(Monitor.newMonitorBuilder()
+ .setProcessNumber(APP.getIpcIndex())
+ .setFileSystem(appFileSystem)
+ .setWatchForHardStop(watchForHardStop)
+ .setWaitForOperational()
+ .addListener(new AppLifecycleListener())
+ .build());
}
App(Monitor monitor) {
@@ -192,7 +198,7 @@ public class App implements Stoppable {
@Override
public void successfulTransition(State from, State to) {
- if (to == State.STARTED) {
+ if (to == State.OPERATIONAL) {
LOGGER.info("SonarQube is up");
}
}