Package org.picocontainer

Examples of org.picocontainer.PicoBuilder


         * SarosContextBuilder}
         */
    }

    private void init(List<Class<?>> excludedComponentsForTestContext) {
        PicoBuilder picoBuilder = new PicoBuilder(new CompositeInjection(
            new ConstructorInjection(), new AnnotatedFieldInjection()))
            .withCaching().withLifecycle();

        /*
         * If given, the dotMonitor is used to capture an architecture diagram
         * of the application
         */
        if (dotMonitor != null) {
            picoBuilder = picoBuilder.withMonitor(dotMonitor);
        }

        // Initialize our dependency injection container
        this.container = picoBuilder.build();

        // Add Adapter which creates ChildContainers
        this.container.as(Characteristics.NO_CACHE).addAdapter(
            new ProviderAdapter(new ChildContainerProvider(this.container)));
        /*
 
View Full Code Here


    private MutablePicoContainer pico;
    private final List<Class<?>> classes = new ArrayList<Class<?>>();
    private final List<Object> instances = new ArrayList<Object>();

    public void createObjects() {
        pico = new PicoBuilder().withCaching().build();
        for (Class<?> clazz : classes) {
            pico.addComponent(clazz);
        }
        for (Object instance : instances) {
            pico.addComponent(instance);
View Full Code Here

                .useStoryLoader(new LoadFromClasspath(EtsyDotComStories.class))
                .useStoryReporterBuilder(reporterBuilder);
        useConfiguration(configuration);

        final ThreadCaching primordialCaching = new ThreadCaching();
        MutablePicoContainer primordial = new PicoBuilder().withBehaviors(primordialCaching).build();
        primordial.addComponent(WebDriverProvider.class, driverProvider);

        // Groovy Steps - can be stateful per story.
        final Storing store = (Storing) new Storing().wrap(new CompositeInjection(new ConstructorInjection(),
                new SetterInjection("set", "setMetaClass")));
View Full Code Here

    private final ComponentMonitor componentMonitor;
    private MutablePicoContainer container;
   
    InjectorImpl(Collection<Class<?>> components) {
        componentMonitor = new NullComponentMonitor();
        container = new PicoBuilder().withMonitor(componentMonitor).withCaching().build();
        addComponents(components);
    }
View Full Code Here

  private PicoBasedContainer container;
  private MutablePicoContainer picoContainer;

  @Before
  public void setup() {
  this.picoContainer = new PicoBuilder().withCaching().build();
  this.container = new PicoBasedContainer(picoContainer);
  }
View Full Code Here

  @Before
  public void setup() {
    MockitoAnnotations.initMocks(this);
   
  container = new PicoBuilder().withCaching().build();
  container.addComponent(DefaultInterceptorRegistry.class);
  container.addComponent(TypeNameExtractor.class, DefaultTypeNameExtractor.class);
  container.addComponent(router);
 
  when(request.getSession()).thenReturn(session);
View Full Code Here

    private static MutablePicoContainer registerComponents(Stage stage) {
        return registerComponents().addComponent(stage);
    }

    public static MutablePicoContainer registerComponents() {
        MutablePicoContainer pico = new PicoBuilder()
            .withJavaEE5Lifecycle()
            .withCaching()
            .build()

            .addAdapter(new LoggerInjector())
View Full Code Here

            container.stop();
        }
    }

    public static MutablePicoContainer registerComponents() {
        MutablePicoContainer pico = new PicoBuilder()
                .withJavaEE5Lifecycle()
                .withCaching()
                .build()

                .addComponent(Conductor.class)
View Full Code Here

TOP

Related Classes of org.picocontainer.PicoBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.