|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the core interface for PicoContainer. It only has accessor methods.
In order to register components in a PicoContainer, use a MutablePicoContainer
,
such as DefaultPicoContainer
.
Method Summary | |
void |
addOrderedComponentAdapter(ComponentAdapter componentAdapter)
Callback method from the implementation to keep track of the instantiation order. |
ComponentAdapter |
getComponentAdapter(Object componentKey)
Finds a ComponentAdapter matching the key, looking in parent if not found in self (unless parent is null). |
ComponentAdapter |
getComponentAdapterOfType(Class componentType)
Finds a ComponentAdapter matching the type, looking in parent if not found in self (unless parent is null). |
Collection |
getComponentAdapters()
Return all adapters (not including the adapters from the parent). |
Object |
getComponentInstance(Object componentKey)
Gets a component instance registered with a specific key. |
Object |
getComponentInstanceOfType(Class componentType)
Finds a component instance matching the type, looking in parent if not found in self (unless parent is null). |
List |
getComponentInstances()
Gets all the registered component instances in the container, (not including those in the parent container). |
Collection |
getComponentKeys()
Deprecated. We don't need to expose this. The collection can be constructed outside with data from getComponentAdapters() . |
PicoContainer |
getParent()
Get the parent container of this container. |
boolean |
hasComponent(Object componentKey)
Deprecated. We don't need this. Can be determined with getComponentInstance(Object) != null. |
void |
verify()
Verifies that the dependencies for all the registered components can be satisfied None of the components are instantiated during the verification process. |
Methods inherited from interface org.picocontainer.lifecycle.Startable |
start |
Methods inherited from interface org.picocontainer.lifecycle.Stoppable |
stop |
Methods inherited from interface org.picocontainer.lifecycle.Disposable |
dispose |
Method Detail |
public boolean hasComponent(Object componentKey)
getComponentInstance(Object)
!= null.
componentKey
- key of the component to look for.
public Collection getComponentKeys()
getComponentAdapters()
.
public Object getComponentInstance(Object componentKey) throws PicoException
componentKey
- key the component was registered with.
PicoException
- if the component could not be instantiated or dependencies
could not be properly resolved.public Object getComponentInstanceOfType(Class componentType)
componentType
- type of the component.
public List getComponentInstances() throws PicoException
PicoException
- if one of the components could not be instantiated or dependencies
could not be properly resolved.public PicoContainer getParent()
PicoContainer
.public void verify() throws PicoVerificationException
PicoVerificationException
- if there are unsatisifiable dependencies.public ComponentAdapter getComponentAdapter(Object componentKey) throws PicoIntrospectionException
componentKey
- key of the component.
PicoIntrospectionException
public ComponentAdapter getComponentAdapterOfType(Class componentType)
componentType
- type of the component.
public Collection getComponentAdapters()
ComponentAdapter
.public void addOrderedComponentAdapter(ComponentAdapter componentAdapter)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |