use of org.picocontainer.ComponentMonitor in project sonarqube by SonarSource.
the class TaskContainerImpl method createContainer.
/**
* Creates a PicContainer which extends the specified ComponentContainer <strong>but is not referenced in return</strong>
* and lazily starts its components.
*/
private static MutablePicoContainer createContainer(ComponentContainer parent) {
ComponentMonitor componentMonitor = new NullComponentMonitor();
ReflectionLifecycleStrategy lifecycleStrategy = new ReflectionLifecycleStrategy(componentMonitor, "start", "stop", "close") {
@Override
public boolean isLazy(ComponentAdapter<?> adapter) {
return adapter.getComponentImplementation().getAnnotation(EagerStart.class) == null;
}
};
return new DefaultPicoContainer(new OptInCaching(), lifecycleStrategy, parent.getPicoContainer(), componentMonitor);
}
use of org.picocontainer.ComponentMonitor in project sonarqube by SonarSource.
the class MigrationContainerImpl method createContainer.
/**
* Creates a PicContainer which extends the specified ComponentContainer <strong>but is not referenced in return</strong>.
*/
private static MutablePicoContainer createContainer(ComponentContainer parent) {
ComponentMonitor componentMonitor = new NullComponentMonitor();
ReflectionLifecycleStrategy lifecycleStrategy = new ReflectionLifecycleStrategy(componentMonitor, "start", "stop", "close") {
@Override
public boolean isLazy(ComponentAdapter<?> adapter) {
return true;
}
};
return new DefaultPicoContainer(new OptInCaching(), lifecycleStrategy, parent.getPicoContainer(), componentMonitor);
}
Aggregations