|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.picocontainer.behaviors.AbstractBehavior<T> org.picocontainer.behaviors.Stored<T>
public class Stored<T>
Nested Class Summary | |
---|---|
static class |
Stored.Instance<T>
|
Nested classes/interfaces inherited from interface org.picocontainer.ComponentAdapter |
---|
ComponentAdapter.NOTHING |
Field Summary |
---|
Fields inherited from class org.picocontainer.behaviors.AbstractBehavior |
---|
delegate |
Constructor Summary | |
---|---|
Stored(ComponentAdapter<T> delegate,
ObjectReference<Stored.Instance<T>> reference)
|
Method Summary | |
---|---|
boolean |
componentHasLifecycle()
Invokes delegate hasLifecycle method if the delegate is a Behavior Test if a component honors a lifecycle. |
void |
dispose(PicoContainer container)
Disposes the cached component instance Invokes delegate dispose method if the delegate is a Behavior Invoke the "dispose" method on the component. |
void |
flush()
Flushes the cache. |
T |
getComponentInstance(PicoContainer container,
Type into)
Retrieve the component instance. |
String |
getDescriptor()
Get a string key descriptor of the component adapter for use in toString() |
protected String |
getLifecycleDescriptor()
|
T |
getStoredObject()
Retrieves the stored reference. |
boolean |
isStarted()
|
void |
start(PicoContainer container)
Starts the cached component instance Invokes delegate start method if the delegate is a Behavior Invoke the "start" method on the component. |
void |
stop(PicoContainer container)
Stops the cached component instance Invokes delegate stop method if the delegate is a Behavior Invoke the "stop" method on the component. |
Methods inherited from class org.picocontainer.behaviors.AbstractBehavior |
---|
accept, changeMonitor, currentMonitor, dispose, findAdapterOfType, getComponentImplementation, getComponentInstance, getComponentKey, getDelegate, hasLifecycle, isLazy, start, stop, toString, verify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Stored(ComponentAdapter<T> delegate, ObjectReference<Stored.Instance<T>> reference)
Method Detail |
---|
public boolean componentHasLifecycle()
AbstractBehavior
componentHasLifecycle
in interface ComponentLifecycle<T>
componentHasLifecycle
in class AbstractBehavior<T>
true
if the component has a lifecyclepublic void dispose(PicoContainer container)
dispose
in interface ComponentLifecycle<T>
dispose
in class AbstractBehavior<T>
container
- the container to "dispose" the componentpublic T getStoredObject()
public void flush()
public T getComponentInstance(PicoContainer container, Type into) throws PicoCompositionException
ComponentAdapter
Cached
will always return the
same instance.
getComponentInstance
in interface ComponentAdapter<T>
getComponentInstance
in class AbstractBehavior<T>
container
- the PicoContainer
, that is used to resolve any possible dependencies of the instance.into
- the class that is about to be injected into. Use ComponentAdapter.NOTHING.class if this is not important to you.
PicoCompositionException
- if the component has dependencies which could not be resolved, or
instantiation of the component lead to an ambiguous situation within the
container.public String getDescriptor()
ComponentAdapter
protected String getLifecycleDescriptor()
public void start(PicoContainer container)
start
in interface ComponentLifecycle<T>
start
in class AbstractBehavior<T>
container
- the container to "start" the componentpublic void stop(PicoContainer container)
stop
in interface ComponentLifecycle<T>
stop
in class AbstractBehavior<T>
container
- the container to "stop" the componentpublic boolean isStarted()
isStarted
in interface ComponentLifecycle<T>
isStarted
in class AbstractBehavior<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |