org.picocontainer
Interface PicoContainer

All Known Subinterfaces:
RegistrationPicoContainer
All Known Implementing Classes:
CompositePicoContainer, DefaultPicoContainer, NullContainer

public interface PicoContainer

PicoContainer - guaranteed to resolve the needs of components as it instantiates them.


Method Summary
 Object getComponent(Object componentKey)
          Get a component for a component type.
 Collection getComponentKeys()
          Get all component types (random order).
 Object getComponentMulticaster()
          Shorthand for getComponentMulticaster(boolean, boolean)(true, true).
 Object getComponentMulticaster(boolean callInInstantiationOrder, boolean callUnmanagedComponents)
          Returns a proxy that implements the union of all the components' interfaces.
 Collection getComponents()
          Get all components (random order).
 boolean hasComponent(Object componentKey)
          Does the internals have a partilcilar component type?
 void instantiateComponents()
          Initialize the internals.
 

Method Detail

hasComponent

public boolean hasComponent(Object componentKey)
Does the internals have a partilcilar component type?

Parameters:
componentKey - The component type to look for.
Returns:
true if it does have the component type

getComponent

public Object getComponent(Object componentKey)
Get a component for a component type.

Parameters:
componentKey - The component type to look for.
Returns:
the component, or null of no such component.

getComponents

public Collection getComponents()
Get all components (random order).

Returns:
A collection of components.

getComponentKeys

public Collection getComponentKeys()
Get all component types (random order).

Returns:
A collection of component types.

instantiateComponents

public void instantiateComponents()
                           throws PicoInitializationException
Initialize the internals.

Throws:
PicoInitializationException

getComponentMulticaster

public Object getComponentMulticaster()
Shorthand for getComponentMulticaster(boolean, boolean)(true, true).

Returns:
a proxy.

getComponentMulticaster

public Object getComponentMulticaster(boolean callInInstantiationOrder,
                                      boolean callUnmanagedComponents)
Returns a proxy that implements the union of all the components' interfaces. Calling a method on the returned Object will call the method on all components in the internals that implement that interface.

Parameters:
callInInstantiationOrder - whether to call the methods in the order of instantiation (true) or reverse (false)
callUnmanagedComponents - whether to exclude components registered via instance rather than class


Copyright © 2003 Codehaus. All Rights Reserved.