|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpicocontainer.defaults.DefaultPicoContainer
Abstract baseclass for various PicoContainer implementations.
Nested Class Summary | |
static class |
DefaultPicoContainer.Default
|
Field Summary | |
protected List |
orderedComponents
|
protected List |
unmanagedComponents
|
Constructor Summary | |
DefaultPicoContainer(ComponentFactory componentFactory)
|
Method Summary | |
void |
addParameterToComponent(Class componentType,
Class parameter,
Object arg)
|
Object |
getAggregateComponentProxy(boolean callInInstantiationOrder,
boolean callUnmanagedComponents)
Returns a proxy that implements the union of all the components' interfaces. |
Object |
getComponent(Class componentType)
Get a component for a component type. |
protected Object |
getComponentForParam(Class parameter)
|
Object[] |
getComponents()
Get all components (random order). |
Class[] |
getComponentTypes()
Get all component types (random order). |
Object |
getMultipleInheritanceProxy()
Shorthand for getAggregateComponentProxy(boolean, boolean) (true, true). |
boolean |
hasComponent(Class componentType)
Does the container have a partilcilar component type? |
protected boolean |
hookEmUp(Class componentImplementation,
Class componentType,
boolean progress)
|
void |
instantiateComponents()
Initialize the container. |
protected Object |
makeComponentInstance(Class type,
Constructor constructor,
Object[] args)
|
void |
registerComponent(Class componentImplementation)
|
void |
registerComponent(Class componentType,
Class componentImplementation)
|
void |
registerComponent(Class componentType,
Object component)
|
void |
registerComponent(Object component)
|
protected boolean |
reuseImplementationIfAppropriate(Class componentType,
Class componentImplementation)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected List orderedComponents
protected List unmanagedComponents
Constructor Detail |
public DefaultPicoContainer(ComponentFactory componentFactory)
Method Detail |
public final Object[] getComponents()
PicoContainer
getComponents
in interface PicoContainer
public Object getMultipleInheritanceProxy()
getAggregateComponentProxy(boolean, boolean)
(true, true).
public Object getAggregateComponentProxy(boolean callInInstantiationOrder, boolean callUnmanagedComponents)
callInInstantiationOrder
- whether to call the methods in the order of instantiation (true) or reverse (false)public void registerComponent(Class componentType, Class componentImplementation) throws DuplicateComponentTypeRegistrationException, AssignabilityRegistrationException, NotConcreteRegistrationException, WrongNumberOfConstructorsRegistrationException
DuplicateComponentTypeRegistrationException
AssignabilityRegistrationException
NotConcreteRegistrationException
WrongNumberOfConstructorsRegistrationException
public void registerComponent(Object component) throws PicoRegistrationException
PicoRegistrationException
public void registerComponent(Class componentType, Object component) throws PicoRegistrationException
PicoRegistrationException
public void addParameterToComponent(Class componentType, Class parameter, Object arg)
public void registerComponent(Class componentImplementation) throws DuplicateComponentTypeRegistrationException, AssignabilityRegistrationException, NotConcreteRegistrationException, WrongNumberOfConstructorsRegistrationException
DuplicateComponentTypeRegistrationException
AssignabilityRegistrationException
NotConcreteRegistrationException
WrongNumberOfConstructorsRegistrationException
public void instantiateComponents() throws PicoInitializationException
PicoContainer
instantiateComponents
in interface PicoContainer
PicoInitializationException
protected boolean hookEmUp(Class componentImplementation, Class componentType, boolean progress) throws AmbiguousComponentResolutionException, PicoInvocationTargetInitailizationException
AmbiguousComponentResolutionException
PicoInvocationTargetInitailizationException
protected boolean reuseImplementationIfAppropriate(Class componentType, Class componentImplementation)
protected Object makeComponentInstance(Class type, Constructor constructor, Object[] args) throws PicoInvocationTargetInitailizationException
PicoInvocationTargetInitailizationException
protected Object getComponentForParam(Class parameter) throws AmbiguousComponentResolutionException
AmbiguousComponentResolutionException
public Object getComponent(Class componentType)
PicoContainer
getComponent
in interface PicoContainer
componentType
- The component type to look for.
public Class[] getComponentTypes()
PicoContainer
getComponentTypes
in interface PicoContainer
public boolean hasComponent(Class componentType)
PicoContainer
hasComponent
in interface PicoContainer
componentType
- The component type to look for.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |