|
![]() |
||||||||||
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
ComponentAdapter
CachingComponentAdapter
will always return the
same instance.
getComponentInstance
in interface ComponentAdapter
getComponentInstance
in class DecoratingComponentAdapter
PicoInitializationException
PicoIntrospectionException
AssignabilityRegistrationException
NotConcreteRegistrationException
public void flush()
public void start(PicoContainer container)
start
in interface LifecycleManager
start
in class DecoratingComponentAdapter
public void stop(PicoContainer container)
stop
in interface LifecycleManager
stop
in class DecoratingComponentAdapter
public void dispose(PicoContainer container)
dispose
in interface LifecycleManager
dispose
in class DecoratingComponentAdapter
public boolean hasLifecycle()
LifecycleManager
hasLifecycle
in interface LifecycleManager
hasLifecycle
in class DecoratingComponentAdapter
|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |