aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-migration
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-10-31 15:24:18 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-11-03 14:29:16 +0100
commita6499246ce47e223255d91179fb6370f421da4d2 (patch)
tree98d211431c058fae7a5cf66d61e7124712bb6f9b /server/sonar-db-migration
parent3f77b1c483891f478fd95cada5f5d1f6f1ea3b14 (diff)
downloadsonarqube-a6499246ce47e223255d91179fb6370f421da4d2.tar.gz
sonarqube-a6499246ce47e223255d91179fb6370f421da4d2.zip
SONAR-9973 ComponentContainer#stopComponent now never fail
and ensures all stoppable and/or disposable components in the container have their stop and/or dispose methods called
Diffstat (limited to 'server/sonar-db-migration')
-rw-r--r--server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/engine/MigrationContainerImpl.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/engine/MigrationContainerImpl.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/engine/MigrationContainerImpl.java
index 96c2fe978cf..bce29650b9a 100644
--- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/engine/MigrationContainerImpl.java
+++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/engine/MigrationContainerImpl.java
@@ -28,6 +28,7 @@ import org.picocontainer.lifecycle.ReflectionLifecycleStrategy;
import org.picocontainer.monitors.NullComponentMonitor;
import org.sonar.api.config.PropertyDefinitions;
import org.sonar.core.platform.ComponentContainer;
+import org.sonar.core.platform.StopSafeReflectionLifecycleStrategy;
import static java.util.Objects.requireNonNull;
@@ -49,7 +50,7 @@ public class MigrationContainerImpl extends ComponentContainer implements Migrat
*/
private static MutablePicoContainer createContainer(ComponentContainer parent) {
ComponentMonitor componentMonitor = new NullComponentMonitor();
- ReflectionLifecycleStrategy lifecycleStrategy = new ReflectionLifecycleStrategy(componentMonitor, "start", "stop", "close") {
+ ReflectionLifecycleStrategy lifecycleStrategy = new StopSafeReflectionLifecycleStrategy(componentMonitor) {
@Override
public boolean isLazy(ComponentAdapter<?> adapter) {
return true;
@@ -60,7 +61,7 @@ public class MigrationContainerImpl extends ComponentContainer implements Migrat
@Override
public void cleanup() {
- stopComponents(true);
+ stopComponents();
}
@Override