|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.picocontainer.behaviors.AbstractBehavior<T>
org.picocontainer.behaviors.Stored<T>
T
- public class Stored<T>
behaviour for all behaviours wishing to store their component in "awkward places" ( object references )
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.picocontainer.ComponentAdapter |
---|
ComponentAdapter.NOTHING |
Field Summary | |
---|---|
protected boolean |
delegateHasLifecylce
|
protected boolean |
disposed
|
protected ObjectReference<T> |
instanceReference
|
protected boolean |
started
|
Fields inherited from class org.picocontainer.behaviors.AbstractBehavior |
---|
delegate |
Constructor Summary | |
---|---|
Stored(ComponentAdapter<T> delegate,
ObjectReference<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. |
T |
getStoredObject()
Retrieves the stored reference. |
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, start, stop, toString, verify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final boolean delegateHasLifecylce
protected boolean disposed
protected final ObjectReference<T> instanceReference
protected boolean started
Constructor Detail |
---|
public Stored(ComponentAdapter<T> delegate, ObjectReference<T> reference)
Method Detail |
---|
public boolean componentHasLifecycle()
AbstractBehavior
componentHasLifecycle
in interface Behavior<T>
componentHasLifecycle
in class AbstractBehavior<T>
true
if the component has a lifecyclepublic void dispose(PicoContainer container)
dispose
in interface Behavior<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
public void start(PicoContainer container)
start
in interface Behavior<T>
start
in class AbstractBehavior<T>
container
- the container to "start" the componentpublic void stop(PicoContainer container)
stop
in interface Behavior<T>
stop
in class AbstractBehavior<T>
container
- the container to "stop" the component
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |