    001    /*****************************************************************************
    002     * Copyright (c) PicoContainer Organization. All rights reserved.            *
    003     * ------------------------------------------------------------------------- *
    004     * The software in this package is published under the terms of the BSD      *
    005     * style license a copy of which has been included with this distribution in *
    006     * the LICENSE.txt file.                                                     *
    007     *                                                                           *
    008     * Idea by Rachel Davies, Original code by various                           *
    009     *****************************************************************************/
    010    package org.nanocontainer.aop;
    011
    012    import org.picocontainer.PicoContainer;
    013    import org.picocontainer.defaults.ComponentAdapterFactory;
    014
    015    /**
    016     * Produces <code>AspectablePicoContainer</code> objects. Mixes in an
    017     * <code>AspectsContainer</code> with a
    018     * <code>org.picocontainer.MutablePicoContainer</code> to produce an
    019     * <code>AspectablePicoContainer</code>.
    020     *
    021     * @author Stephen Molitor
    022     * @author Mauro Talevi
    023     * @version $Revision: 3144 $
    024     */
    025    public interface AspectablePicoContainerFactory {
    026
    027        /**
    028         * Creates a new <code>AspectablePicoContainer</code>.
    029         *
    030         * @param containerClass          the class of the basic container to delegate to.
    031         * @param aspectsManager          the aspects manager used to register and apply
    032         *                                aspects.
    033         * @param componentAdapterFactory the delegate component adapter factory
    034         *                                used to produce components.
    035         * @param parent                  the parent container.
    036         * @return a new <code>AspectablePicoContainer</code>.
    037         */
    038        public AspectablePicoContainer createContainer(Class containerClass, AspectsManager aspectsManager,
    039                                                       ComponentAdapterFactory componentAdapterFactory, PicoContainer parent);
    040
    041        /**
    042         * Creates a new <code>AspectablePicoContainer</code>.
    043         *
    044         * @param containerClass          the class of the basic container to delegate to.
    045         * @param componentAdapterFactory the delegate component adapter factory
    046         *                                used to produce components.
    047         * @param parent                  the parent container.
    048         * @return a new <code>AspectablePicoContainer</code>.
    049         */
    050        AspectablePicoContainer createContainer(Class containerClass, ComponentAdapterFactory componentAdapterFactory,
    051                                                PicoContainer parent);
    052
    053        /**
    054         * Creates a new <code>AspectablePicoContainer</code>. Uses
    055         * <code>org.picocontainer.defaults.DefaultPicoContainer</code> as the
    056         * delegate container.
    057         *
    058         * @param componentAdapterFactory the delegate component adapter factory
    059         *                                used to produce components.
    060         * @param parent                  the parent container.
    061         * @return a new <code>AspectablePicoContainer</code>.
    062         */
    063        AspectablePicoContainer createContainer(ComponentAdapterFactory componentAdapterFactory, PicoContainer parent);
    064
    065        /**
    066         * Creates a new <code>AspectablePicoContainer</code>. Uses
    067         * <code>org.picocontainer.defaults.DefaultPicoContainer</code> as the
    068         * delegate container.
    069         *
    070         * @param componentAdapterFactory the delegate component adapter factory
    071         *                                used to produce components.
    072         * @return a new <code>AspectablePicoContainer</code>.
    073         */
    074        AspectablePicoContainer createContainer(ComponentAdapterFactory componentAdapterFactory);
    075
    076        /**
    077         * Creates a new <code>AspectablePicoContainer</code>. Uses
    078         * <code>org.picocontainer.defaults.DefaultPicoContainer</code> as the
    079         * delegate container. Uses
    080         * <code>org.picocontainer.defaults.DefaultComponentAdapterFactory</code>
    081         * as the delegate component adapter factory.
    082         *
    083         * @param parent the parent container.
    084         * @return a new <code>AspectablePicoContainer</code>.
    085         */
    086        AspectablePicoContainer createContainer(PicoContainer parent);
    087
    088        /**
    089         * Creates a new <code>AspectablePicoContainer</code>. Uses
    090         * <code>org.picocontainer.defaults.DefaultPicoContainer</code> as the
    091         * delegate container. Uses
    092         * <code>org.picocontainer.defaults.DefaultComponentAdapterFactory</code>
    093         * as the delegate component adapter factory.
    094         *
    095         * @return a new <code>AspectablePicoContainer</code>.
    096         */
    097        AspectablePicoContainer createContainer();
    098
    099        /**
    100         * Make a child <code>AspectablePicoContainer</code> of a given <code>AspectablePicoContainer</code>.
    101         * The child container will be obtained aspectifying <code>MutablePicoContainer#makeChildContainer()</code>.
    102         *
    103         * @param aspectsManager the aspects manager used to register and apply aspects.
    104         * @param parent the parent AspectablePicoContainer
    105         * @return A child AspectablePicoContainer
    106         */
    107        AspectablePicoContainer makeChildContainer(AspectsManager aspectsManager, AspectablePicoContainer parent);
    108
    109        /**
    110         * Make a child <code>AspectablePicoContainer</code> of a given <code>AspectablePicoContainer</code>
    111         * The child container will be obtained aspectifying <code>MutablePicoContainer#makeChildContainer()</code>.
    112         *
    113         * @param parent the parent AspectablePicoContainer
    114         * @return A child AspectablePicoContainer
    115         */
    116        AspectablePicoContainer makeChildContainer(AspectablePicoContainer parent);
    117
    118    }