01: /*****************************************************************************
02: * Copyright (C) PicoContainer Organization. All rights reserved. *
03: * ------------------------------------------------------------------------- *
04: * The software in this package is published under the terms of the BSD *
05: * style license a copy of which has been included with this distribution in *
06: * the LICENSE.txt file. *
07: * *
08: * Original code by *
09: *****************************************************************************/package org.picocontainer.behaviors;
10:
11: import org.picocontainer.ComponentAdapter;
12: import org.picocontainer.ComponentMonitor;
13: import org.picocontainer.LifecycleStrategy;
14: import org.picocontainer.Parameter;
15: import org.picocontainer.PicoCompositionException;
16: import org.picocontainer.Characteristics;
17:
18: import java.io.Serializable;
19: import java.util.Properties;
20:
21: public class Automating extends AbstractBehaviorFactory implements
22: Serializable {
23:
24: public ComponentAdapter createComponentAdapter(
25: ComponentMonitor componentMonitor,
26: LifecycleStrategy lifecycleStrategy,
27: Properties componentProperties, Object componentKey,
28: Class componentImplementation, Parameter... parameters)
29: throws PicoCompositionException {
30: removePropertiesIfPresent(componentProperties,
31: Characteristics.AUTOMATIC);
32: return new Automated(super .createComponentAdapter(
33: componentMonitor, lifecycleStrategy,
34: componentProperties, componentKey,
35: componentImplementation, parameters));
36: }
37:
38: public ComponentAdapter addComponentAdapter(
39: ComponentMonitor componentMonitor,
40: LifecycleStrategy lifecycleStrategy,
41: Properties componentProperties, ComponentAdapter adapter) {
42: removePropertiesIfPresent(componentProperties,
43: Characteristics.AUTOMATIC);
44: return new Automated(super.addComponentAdapter(
45: componentMonitor, lifecycleStrategy,
46: componentProperties, adapter));
47: }
48: }
|