001 /*******************************************************************************
002 * Copyright (C) PicoContainer Organization. All rights reserved.
003 * ---------------------------------------------------------------------------
004 * The software in this package is published under the terms of the BSD style
005 * license a copy of which has been included with this distribution in the
006 * LICENSE.txt file.
007 ******************************************************************************/
008 package org.picocontainer.script;
009
010 import org.picocontainer.Characteristics;
011 import org.picocontainer.DefaultPicoContainer;
012 import org.picocontainer.PicoContainer;
013
014 /**
015 * Default builder creates an empty caching DefaultPicoContainer.
016 * <p>Note that assembly scope is ignored when creating the container.</p>
017 */
018 public class DefaultContainerBuilder extends AbstractContainerBuilder {
019
020 public DefaultContainerBuilder() {
021 //default constructor
022 }
023
024 // TODO better solution to activate default caching
025 @Override
026 protected PicoContainer createContainer(PicoContainer parentContainer, Object assemblyScope) {
027 return (new DefaultPicoContainer(parentContainer)).change(Characteristics.CACHE);
028 }
029 }