|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.picocontainer.alternatives.EmptyPicoContainer
public class EmptyPicoContainer
empty pico container serving as recoil damper in situations where you do not like to check whether container reference suplpied to you is null or not
Constructor Summary | |
---|---|
EmptyPicoContainer()
|
Method Summary | |
---|---|
void |
accept(PicoVisitor visitor)
Accepts a visitor that should visit the child containers, component adapters and component instances. |
void |
dispose()
Dispose this component. |
ComponentAdapter |
getComponentAdapter(java.lang.Object componentKey)
Find a component adapter associated with the specified key. |
ComponentAdapter |
getComponentAdapterOfType(java.lang.Class componentType)
Find a component adapter associated with the specified type. |
java.util.Collection |
getComponentAdapters()
Retrieve all the component adapters inside this container. |
java.util.List |
getComponentAdaptersOfType(java.lang.Class componentType)
Retrieve all component adapters inside this container that are associated with the specified type. |
java.lang.Object |
getComponentInstance(java.lang.Object componentKey)
Retrieve a component instance registered with a specific key. |
java.lang.Object |
getComponentInstanceOfType(java.lang.Class componentType)
Find a component instance matching the specified type. |
java.util.List |
getComponentInstances()
Retrieve all the registered component instances in the container, (not including those in the parent container). |
java.util.List |
getComponentInstancesOfType(java.lang.Class componentType)
Returns a List of components of a certain componentType. |
PicoContainer |
getParent()
Retrieve the parent container of this container. |
void |
start()
Start this component. |
void |
stop()
Stop this component. |
void |
verify()
Verify that the dependencies for all the registered components can be satisfied. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EmptyPicoContainer()
Method Detail |
---|
public java.lang.Object getComponentInstance(java.lang.Object componentKey)
PicoContainer
getComponentInstance
in interface PicoContainer
componentKey
- the key that the component was registered with.
null
if no component has been registered for the specified
key.public java.lang.Object getComponentInstanceOfType(java.lang.Class componentType)
PicoContainer
getComponentInstanceOfType
in interface PicoContainer
componentType
- the type of the component
null
if no component has been registered
with a matching typepublic java.util.List getComponentInstances()
PicoContainer
getComponentInstances
in interface PicoContainer
public PicoContainer getParent()
PicoContainer
getParent
in interface PicoContainer
PicoContainer
instance, or null
if this container does not have a parent.public ComponentAdapter getComponentAdapter(java.lang.Object componentKey)
PicoContainer
getComponentAdapter
in interface PicoContainer
componentKey
- the key that the component was registered with.
null
if no component has been
registered for the specified key.public ComponentAdapter getComponentAdapterOfType(java.lang.Class componentType)
PicoContainer
getComponentAdapterOfType
in interface PicoContainer
componentType
- the type of the component.
null
if no component has been
registered for the specified key.public java.util.Collection getComponentAdapters()
PicoContainer
getComponentAdapters
in interface PicoContainer
ComponentAdapter
s inside this container. The collection will not
be modifiable.a variant of this method which returns the component adapters inside this
container that are associated with the specified type.
public java.util.List getComponentAdaptersOfType(java.lang.Class componentType)
PicoContainer
getComponentAdaptersOfType
in interface PicoContainer
componentType
- the type of the components.
ComponentAdapter
s inside this container that are associated with
the specified type. Changes to this collection will not be reflected in the container itself.public void verify()
PicoContainer
verify
in interface PicoContainer
public void accept(PicoVisitor visitor)
PicoContainer
accept
in interface PicoContainer
visitor
- the visitorpublic java.util.List getComponentInstancesOfType(java.lang.Class componentType)
PicoContainer
getComponentInstancesOfType
in interface PicoContainer
componentType
- the searched type.
public void start()
Startable
start
in interface Startable
public void stop()
Startable
Disposable
if you need a single call at the definite end of the lifecycle.
stop
in interface Startable
public void dispose()
Disposable
dispose
in interface Disposable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |