diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-10-31 15:24:18 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-11-03 14:29:16 +0100 |
commit | a6499246ce47e223255d91179fb6370f421da4d2 (patch) | |
tree | 98d211431c058fae7a5cf66d61e7124712bb6f9b /server/sonar-db-migration | |
parent | 3f77b1c483891f478fd95cada5f5d1f6f1ea3b14 (diff) | |
download | sonarqube-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.java | 5 |
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 |