org.picocontainer.gems.adapters
Class HotSwappingComponentAdapter
java.lang.Object
org.picocontainer.defaults.DecoratingComponentAdapter
org.picocontainer.gems.adapters.HotSwappingComponentAdapter
- All Implemented Interfaces:
- java.io.Serializable, org.picocontainer.ComponentAdapter, org.picocontainer.defaults.ComponentMonitorStrategy, org.picocontainer.defaults.LifecycleStrategy, org.picocontainer.LifecycleManager
public class HotSwappingComponentAdapter
- extends org.picocontainer.defaults.DecoratingComponentAdapter
This component adapter makes it possible to hide the implementation of a real subject (behind a proxy). If the key of the
component is of type Class
and that class represents an interface, the proxy will only implement the interface
represented by that Class. Otherwise (if the key is something else), the proxy will implement all the interfaces of the
underlying subject. In any case, the proxy will also implement Swappable
, making
it possible to swap out the underlying subject at runtime.
Note that this class doesn't cache instances. If you want caching,
use a CachingComponentAdapter
around this one.
- Version:
- $Revision: 2631 $
- Author:
- Paul Hammant, Aslak Hellesøy
- See Also:
- Serialized Form
Field Summary |
private com.thoughtworks.proxy.ProxyFactory |
proxyFactory
|
Methods inherited from class org.picocontainer.defaults.DecoratingComponentAdapter |
accept, changeMonitor, currentMonitor, dispose, dispose, getComponentImplementation, getComponentKey, getDelegate, hasLifecycle, hasLifecycle, start, start, stop, stop, toString, verify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
proxyFactory
private final com.thoughtworks.proxy.ProxyFactory proxyFactory
HotSwappingComponentAdapter
public HotSwappingComponentAdapter(org.picocontainer.ComponentAdapter delegate,
com.thoughtworks.proxy.ProxyFactory proxyFactory)
HotSwappingComponentAdapter
public HotSwappingComponentAdapter(org.picocontainer.ComponentAdapter delegate)
getComponentInstance
public java.lang.Object getComponentInstance(org.picocontainer.PicoContainer container)
- Specified by:
getComponentInstance
in interface org.picocontainer.ComponentAdapter
- Overrides:
getComponentInstance
in class org.picocontainer.defaults.DecoratingComponentAdapter