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: * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
09: *****************************************************************************/package org.picocontainer.gems.behaviors;
10:
11: import org.picocontainer.ComponentAdapter;
12: import org.picocontainer.Parameter;
13: import org.picocontainer.PicoCompositionException;
14: import org.picocontainer.ComponentMonitor;
15: import org.picocontainer.LifecycleStrategy;
16: import org.picocontainer.behaviors.AbstractBehaviorFactory;
17:
18: import java.util.Properties;
19:
20: /**
21: * Hides implementation.
22: *
23: * @author Paul Hammant
24: * @author Aslak Hellesøy
25: * @see HotSwappable
26: */
27: public class HotSwapping extends AbstractBehaviorFactory {
28:
29: public ComponentAdapter createComponentAdapter(
30: ComponentMonitor componentMonitor,
31: LifecycleStrategy lifecycleStrategy,
32: Properties componentProperties, Object componentKey,
33: Class componentImplementation, Parameter... parameters)
34: throws PicoCompositionException {
35: ComponentAdapter componentAdapter = super
36: .createComponentAdapter(componentMonitor,
37: lifecycleStrategy, componentProperties,
38: componentKey, componentImplementation,
39: parameters);
40: return new HotSwappable(componentAdapter);
41: }
42:
43: public ComponentAdapter addComponentAdapter(
44: ComponentMonitor componentMonitor,
45: LifecycleStrategy lifecycleStrategy,
46: Properties componentProperties, ComponentAdapter adapter) {
47: return new HotSwappable(super.addComponentAdapter(
48: componentMonitor, lifecycleStrategy,
49: componentProperties, adapter));
50: }
51: }
|