org.picocontainer
public interface PicoContainer extends Startable, Disposable
Since: 1.0
See Also: See package description for basic overview how to use
PicoContainer.
Method Summary | |
---|---|
void | accept(PicoVisitor visitor)
Accepts a visitor that should visit the child containers, component adapters and component instances.
|
ComponentAdapter | getComponentAdapter(Object componentKey)
Find a component adapter associated with the specified key. |
ComponentAdapter | getComponentAdapterOfType(Class componentType)
Find a component adapter associated with the specified type. |
Collection | getComponentAdapters()
Retrieve all the component adapters inside this container. |
List | getComponentAdaptersOfType(Class componentType)
Retrieve all component adapters inside this container that are associated with the specified type. |
Object | getComponentInstance(Object componentKey)
Retrieve a component instance registered with a specific key. |
Object | getComponentInstanceOfType(Class componentType)
Find a component instance matching the specified type.
|
List | getComponentInstances()
Retrieve all the registered component instances in the container, (not including those in the parent container).
|
List | getComponentInstancesOfType(Class componentType)
Returns a List of components of a certain componentType. |
PicoContainer | getParent()
Retrieve the parent container of this container.
|
void | verify()
Verify that the dependencies for all the registered components can be satisfied. |
Parameters: visitor the visitor
Since: 1.1
Parameters: componentKey the key that the component was registered with.
Returns: the component adapter associated with this key, or null
if no component has been
registered for the specified key.
Parameters: componentType the type of the component.
Returns: the component adapter associated with this class, or null
if no component has been
registered for the specified key.
Returns: a collection containing all the ComponentAdapters inside this container. The collection will not be modifiable.
Parameters: componentType the type of the components.
Returns: a collection containing all the ComponentAdapters inside this container that are associated with the specified type. Changes to this collection will not be reflected in the container itself.
Parameters: componentKey the key that the component was registered with.
Returns: an instantiated component, or null
if no component has been registered for the specified
key.
Parameters: componentType the type of the component
Returns: an instantiated component matching the class, or null
if no component has been registered
with a matching type
Throws: PicoException if the instantiation of the component fails
Returns: all the components.
Throws: PicoException if the instantiation of the component fails
Parameters: componentType the searched type.
Returns: a List of components.
Throws: PicoException if the instantiation of a component fails
Since: 1.1
Returns: a PicoContainer instance, or null
if this container does not have a parent.
Deprecated: since 1.1 - Use "new VerifyingVisitor().traverse(this)"
Verify that the dependencies for all the registered components can be satisfied. No components are instantiated during the verification process.Throws: PicoVerificationException if there are unsatisifiable dependencies.