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 Aslak Hellesoy and Paul Hammant   *
009     *****************************************************************************/
010    
011    package org.picocontainer.injectors;
012    
013    import org.picocontainer.ComponentAdapter;
014    import org.picocontainer.ComponentMonitor;
015    import org.picocontainer.Parameter;
016    import org.picocontainer.PicoCompositionException;
017    import org.picocontainer.LifecycleStrategy;
018    import org.picocontainer.ComponentFactory;
019    import org.picocontainer.InjectionFactory;
020    
021    import java.io.Serializable;
022    import java.util.Properties;
023    
024    /**
025     * @author Jon Tirsén
026     */
027    public class ConstructorInjection implements InjectionFactory, Serializable {
028    
029    
030        public ComponentAdapter createComponentAdapter(ComponentMonitor componentMonitor, LifecycleStrategy lifecycleStrategy, Properties componentProperties, Object componentKey,
031                                                       Class componentImplementation,
032                                                       Parameter... parameters)
033                throws PicoCompositionException {
034            return new ConstructorInjector(componentKey, componentImplementation, parameters,
035                        componentMonitor, lifecycleStrategy);
036        }
037    }