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 *****************************************************************************/
009package org.picocontainer.behaviors;
010
011import org.picocontainer.ComponentAdapter;
012import org.picocontainer.ComponentMonitor;
013import org.picocontainer.LifecycleStrategy;
014import org.picocontainer.Parameter;
015import org.picocontainer.PicoCompositionException;
016
017import java.util.Properties;
018
019
020/** @author Paul Hammant */
021@SuppressWarnings("serial")
022public class Intercepting extends AbstractBehaviorFactory {
023
024    public <T> ComponentAdapter<T> createComponentAdapter(ComponentMonitor componentMonitor,
025                                                          LifecycleStrategy lifecycleStrategy,
026                                                          Properties componentProperties,
027                                                          Object componentKey,
028                                                          Class<T> componentImplementation,
029                                                          Parameter... parameters) throws PicoCompositionException {
030        return componentMonitor.newBehavior(new Intercepted(super.createComponentAdapter(componentMonitor,
031                                                            lifecycleStrategy, componentProperties, componentKey,
032                                                            componentImplementation, parameters)));
033    }
034}