    001    /*****************************************************************************
    002     * Copyright (C) NanoContainer 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     * Original code by                                                          *
    009     *****************************************************************************/
    010
    011    package org.nanocontainer.integrationkit;
    012
    013    import org.picocontainer.MutablePicoContainer;
    014    import org.picocontainer.PicoContainer;
    015    import org.picocontainer.defaults.DefaultPicoContainer;
    016
    017    public class DefaultLifecycleContainerBuilder extends LifecycleContainerBuilder {
    018        private final ContainerComposer composer;
    019
    020        public DefaultLifecycleContainerBuilder(ContainerComposer composer) {
    021            this.composer = composer;
    022        }
    023
    024        protected void composeContainer(MutablePicoContainer container, Object assemblyScope) {
    025            composer.composeContainer(container, assemblyScope);
    026        }
    027
    028        protected PicoContainer createContainer(PicoContainer parentContainer, Object assemblyScope) {
    029            return new DefaultPicoContainer(parentContainer);
    030        }
    031    }