diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2019-05-20 12:17:54 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-05-23 20:21:09 +0200 |
commit | 49451f5a6eb77a234072584192eaa576c78e3390 (patch) | |
tree | 1004708f085dcb2394951b12123451e90df80e11 /server/sonar-ce-task | |
parent | 84c34d5279752a7ec892db767e9aa092aadefc9f (diff) | |
download | sonarqube-49451f5a6eb77a234072584192eaa576c78e3390.tar.gz sonarqube-49451f5a6eb77a234072584192eaa576c78e3390.zip |
SONAR-10034 drop support of reflection-based Pico Container lifecycle management
one must now implement org.picocontainer.Startable, org.sonar.api.Startable, java.io.Closeable and/or java.lang.Closeable
Diffstat (limited to 'server/sonar-ce-task')
-rw-r--r-- | server/sonar-ce-task/src/main/java/org/sonar/ce/task/container/TaskContainerImpl.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/server/sonar-ce-task/src/main/java/org/sonar/ce/task/container/TaskContainerImpl.java b/server/sonar-ce-task/src/main/java/org/sonar/ce/task/container/TaskContainerImpl.java index 52b78b22a06..9dc7160622f 100644 --- a/server/sonar-ce-task/src/main/java/org/sonar/ce/task/container/TaskContainerImpl.java +++ b/server/sonar-ce-task/src/main/java/org/sonar/ce/task/container/TaskContainerImpl.java @@ -21,18 +21,17 @@ package org.sonar.ce.task.container; import java.util.List; import org.picocontainer.ComponentAdapter; -import org.picocontainer.ComponentMonitor; import org.picocontainer.DefaultPicoContainer; +import org.picocontainer.LifecycleStrategy; import org.picocontainer.MutablePicoContainer; import org.picocontainer.behaviors.OptInCaching; -import org.picocontainer.lifecycle.ReflectionLifecycleStrategy; import org.picocontainer.monitors.NullComponentMonitor; import org.sonar.api.config.PropertyDefinitions; import org.sonar.api.utils.log.Loggers; import org.sonar.core.platform.ComponentContainer; import org.sonar.core.platform.ContainerPopulator; import org.sonar.core.platform.Module; -import org.sonar.core.platform.StopSafeReflectionLifecycleStrategy; +import org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy; import static java.util.Objects.requireNonNull; @@ -61,15 +60,14 @@ public class TaskContainerImpl extends ComponentContainer implements TaskContain * and lazily starts its components. */ private static MutablePicoContainer createContainer(ComponentContainer parent) { - ComponentMonitor componentMonitor = new NullComponentMonitor(); - ReflectionLifecycleStrategy lifecycleStrategy = new StopSafeReflectionLifecycleStrategy(componentMonitor) { + LifecycleStrategy lifecycleStrategy = new StartableCloseableSafeLifecyleStrategy() { @Override public boolean isLazy(ComponentAdapter<?> adapter) { return adapter.getComponentImplementation().getAnnotation(EagerStart.class) == null; } }; - return new DefaultPicoContainer(new OptInCaching(), lifecycleStrategy, parent.getPicoContainer(), componentMonitor); + return new DefaultPicoContainer(new OptInCaching(), lifecycleStrategy, parent.getPicoContainer(), new NullComponentMonitor()); } @Override |