|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.picocontainer.defaults.DecoratingComponentAdapter
org.picocontainer.defaults.CachingComponentAdapter
ComponentAdapter implementation that caches the component instance.
This adapter supports components with a lifecycle, as it is a lifecycle manager
which will apply the delegate's lifecycle strategy to the cached component instance.
The lifecycle state is maintained so that the component instance behaves in the expected way:
it can't be started if already started, it can't be started or stopped if disposed, it can't
be stopped if not started, it can't be disposed if already disposed.
| Constructor Summary | |
CachingComponentAdapter(ComponentAdapter delegate)
|
|
CachingComponentAdapter(ComponentAdapter delegate,
ObjectReference instanceReference)
|
|
| Method Summary | |
void |
dispose(PicoContainer container)
Disposes the cached component instance Invokes delegate dispose method if the delegate is a LifecycleManager Invoke the "dispose" method on the container's components. |
void |
flush()
Flushes the cache. |
Object |
getComponentInstance(PicoContainer container)
Retrieve the component instance. |
boolean |
hasLifecycle()
Test if a container's component has a lifecycle. |
void |
start(PicoContainer container)
Starts the cached component instance Invokes delegate start method if the delegate is a LifecycleManager Invoke the "start" method on the container's components. |
void |
stop(PicoContainer container)
Stops the cached component instance Invokes delegate stop method if the delegate is a LifecycleManager Invoke the "stop" method on the container's components. |
| Methods inherited from class org.picocontainer.defaults.DecoratingComponentAdapter |
accept, changeMonitor, currentMonitor, dispose, getComponentImplementation, getComponentKey, getDelegate, hasLifecycle, start, stop, toString, verify |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public CachingComponentAdapter(ComponentAdapter delegate)
public CachingComponentAdapter(ComponentAdapter delegate,
ObjectReference instanceReference)
| Method Detail |
public Object getComponentInstance(PicoContainer container)
throws PicoInitializationException,
PicoIntrospectionException,
AssignabilityRegistrationException,
NotConcreteRegistrationException
ComponentAdapterCachingComponentAdapter will always return the
same instance.
getComponentInstance in interface ComponentAdaptergetComponentInstance in class DecoratingComponentAdapterPicoInitializationException
PicoIntrospectionException
AssignabilityRegistrationException
NotConcreteRegistrationExceptionpublic void flush()
public void start(PicoContainer container)
start in interface LifecycleManagerstart in class DecoratingComponentAdapterpublic void stop(PicoContainer container)
stop in interface LifecycleManagerstop in class DecoratingComponentAdapterpublic void dispose(PicoContainer container)
dispose in interface LifecycleManagerdispose in class DecoratingComponentAdapterpublic boolean hasLifecycle()
LifecycleManager
hasLifecycle in interface LifecycleManagerhasLifecycle in class DecoratingComponentAdapter
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||