From 49451f5a6eb77a234072584192eaa576c78e3390 Mon Sep 17 00:00:00 2001 From: Sébastien Lesaint Date: Mon, 20 May 2019 12:17:54 +0200 Subject: 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 --- .../java/org/sonar/ce/task/container/TaskContainerImpl.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'server/sonar-ce-task/src') 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 -- cgit v1.2.3