Package org.picocontainer.defaults

Examples of org.picocontainer.defaults.ConstructorInjectionComponentAdapterFactory


        DynamicMBeanProvider _decoratedProvider = new UnregisterObjectNameProviderDecorator(
                mbeanServer, mbeanProvider);

        ComponentAdapterFactory _defaultCAF = new JMXExposingComponentAdapterFactory(
                new ConstructorInjectionComponentAdapterFactory(), mbeanServer,
                new DynamicMBeanProvider[] { _decoratedProvider });

        ComponentAdapterFactory _cachingCAF = new CachingComponentAdapterFactory(
                _defaultCAF);
View Full Code Here


        return _container;
    }

    private static MutablePicoContainer createContainer(final Logger logger)
    {
        final ConstructorInjectionComponentAdapterFactory _nonCachingCAFactory = new ConstructorInjectionComponentAdapterFactory(); //false, new ConsoleComponentMonitor(System.out));
        final ComponentAdapterFactory _cachingCAFactory = new CachingComponentAdapterFactory(_nonCachingCAFactory);
        final MutablePicoContainer _container = new DefaultPicoContainer(_cachingCAFactory);

        _container.registerComponentInstance(ComponentAdapterFactory.class,
                _nonCachingCAFactory);
View Full Code Here

        loadFilterPlugins(config);
    }

    public DefaultFilterFactoryDelegate(IContainer container, Configuration config)
    {
        this(container, config, new ConstructorInjectionComponentAdapterFactory());
    }
View Full Code Here

     * Test creation of a CA ensuring ThreadLocal-behaviour.
     * @throws InterruptedException
     */
    public final void testCreateComponentAdapterEnsuringThreadLocal() throws InterruptedException {
        final ComponentAdapterFactory componentAdapterFactory = new ThreadLocalComponentAdapterFactory(
                new ConstructorInjectionComponentAdapterFactory());
        final ComponentAdapter componentAdapter = componentAdapterFactory.createComponentAdapter(
                List.class, ArrayList.class, new Parameter[]{});
        final List list = (List)componentAdapter.getComponentInstance(null);
        list.add(this);
        final List list2 = new ArrayList();
View Full Code Here

     * Test creation of a CA failing ThreadLocal-behaviour.
     * @throws InterruptedException
     */
    public final void testCreateComponentAdapterFailingThreadLocal() throws InterruptedException {
        final ComponentAdapterFactory componentAdapterFactory = new ThreadLocalComponentAdapterFactory(
                new ConstructorInjectionComponentAdapterFactory(), ThreadLocalComponentAdapterFactory.THREAD_ENSURES_LOCALITY);
        final ComponentAdapter componentAdapter = componentAdapterFactory.createComponentAdapter(
                List.class, ArrayList.class, new Parameter[]{});
        final List list = (List)componentAdapter.getComponentInstance(null);
        list.add(this);
        final List list2 = new ArrayList();
View Full Code Here

     * Test creation of a CA with ThreadLocal-behaviour works if the thread ensures creation.
     * @throws InterruptedException
     */
    public final void testCreateComponentAdapterWorksForDifferentThreads() throws InterruptedException {
        final ComponentAdapterFactory componentAdapterFactory = new ThreadLocalComponentAdapterFactory(
                new ConstructorInjectionComponentAdapterFactory(), ThreadLocalComponentAdapterFactory.THREAD_ENSURES_LOCALITY);
        final ComponentAdapter componentAdapter = componentAdapterFactory.createComponentAdapter(
                List.class, ArrayList.class, new Parameter[]{});
        final List list = (List)componentAdapter.getComponentInstance(null);
        list.add(this);
        final List list2 = new ArrayList();
View Full Code Here

    /**
     * @see org.picocontainer.tck.AbstractComponentAdapterFactoryTestCase#createComponentAdapterFactory()
     */
    protected ComponentAdapterFactory createComponentAdapterFactory() {
        return new AssimilatingComponentAdapterFactory(new ConstructorInjectionComponentAdapterFactory(), Touchable.class);
    }
View Full Code Here

        assertFalse(collection instanceof List);
        assertFalse(collection instanceof ArrayList);
    }

    public void testComponentRegisteredWithOtherKeyImplementsAllInterfacesUsingStandardProxyFactory() {
        DefaultPicoContainer pico = new DefaultPicoContainer(new HotSwappingComponentAdapterFactory(new ConstructorInjectionComponentAdapterFactory()));
        pico.registerComponentImplementation("list", ArrayList.class);
        Object collection = pico.getComponentInstance("list");
        assertTrue(collection instanceof List);
        assertFalse(collection instanceof ArrayList);
    }
View Full Code Here

        assertTrue(collection instanceof List);
        assertFalse(collection instanceof ArrayList);
    }

    public void testComponentRegisteredWithInterfaceKeyOnlyImplementsThatInterfaceUsingCGLIBProxyfactory() {
        DefaultPicoContainer pico = new DefaultPicoContainer(new HotSwappingComponentAdapterFactory(new ConstructorInjectionComponentAdapterFactory(), new CglibProxyFactory()));
        pico.registerComponentImplementation(Collection.class, ArrayList.class);
        Object collection = pico.getComponentInstance(Collection.class);
        assertTrue(collection instanceof Collection);
        assertFalse(collection instanceof List);
        assertFalse(collection instanceof ArrayList);
View Full Code Here

        assertFalse(collection instanceof List);
        assertFalse(collection instanceof ArrayList);
    }

    public void testComponentRegisteredWithOtherKeyImplementsAllInterfacesUsingCGLIBProxyFactory() {
        DefaultPicoContainer pico = new DefaultPicoContainer(new HotSwappingComponentAdapterFactory(new ConstructorInjectionComponentAdapterFactory(), new CglibProxyFactory()));
        pico.registerComponentImplementation("list", ArrayList.class);
        Object collection = pico.getComponentInstance("list");
        assertTrue(collection instanceof Collection);
        assertTrue(collection instanceof List);
        assertTrue(collection instanceof ArrayList);
View Full Code Here

TOP

Related Classes of org.picocontainer.defaults.ConstructorInjectionComponentAdapterFactory

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.