org.picocontainer.extras
Class HierarchicalComponentRegistry

java.lang.Object
  extended byorg.picocontainer.extras.HierarchicalComponentRegistry
All Implemented Interfaces:
ComponentRegistry, Serializable
Direct Known Subclasses:
HierarchicalComponentRegistry.Default, HierarchicalComponentRegistry.WithChildRegistry

public class HierarchicalComponentRegistry
extends Object
implements ComponentRegistry, Serializable

See Also:
Serialized Form

Nested Class Summary
static class HierarchicalComponentRegistry.Default
           
static class HierarchicalComponentRegistry.WithChildRegistry
           
 
Field Summary
protected  ComponentRegistry childRegistry
           
protected  ComponentRegistry parentRegistry
           
 
Constructor Summary
protected HierarchicalComponentRegistry(ComponentRegistry parentRegistry, ComponentRegistry childRegistry)
           
 
Method Summary
 void addOrderedComponent(Object component)
           
 boolean contains(Object componentKey)
           
 Object createComponent(ComponentSpecification componentSpecification)
           
 Object findImplementingComponent(Class componentType)
           
 ComponentSpecification findImplementingComponentSpecification(Class componentType)
           
 Object getComponentInstance(Object componentKey)
           
 Set getComponentInstanceKeys()
           
 Set getComponentInstances()
           
 ComponentSpecification getComponentSpec(Object componentKey)
           
 Collection getComponentSpecifications()
           
 List getOrderedComponents()
           
 boolean hasComponentInstance(Object componentKey)
           
 void putComponent(Object componentKey, Object component)
           
 void registerComponent(ComponentSpecification compSpec)
           
 void unregisterComponent(Object componentKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentRegistry

protected final ComponentRegistry parentRegistry

childRegistry

protected final ComponentRegistry childRegistry
Constructor Detail

HierarchicalComponentRegistry

protected HierarchicalComponentRegistry(ComponentRegistry parentRegistry,
                                        ComponentRegistry childRegistry)
Method Detail

registerComponent

public void registerComponent(ComponentSpecification compSpec)
Specified by:
registerComponent in interface ComponentRegistry

unregisterComponent

public void unregisterComponent(Object componentKey)
Specified by:
unregisterComponent in interface ComponentRegistry

getComponentSpecifications

public Collection getComponentSpecifications()
Specified by:
getComponentSpecifications in interface ComponentRegistry

getOrderedComponents

public List getOrderedComponents()
Specified by:
getOrderedComponents in interface ComponentRegistry

addOrderedComponent

public void addOrderedComponent(Object component)
Specified by:
addOrderedComponent in interface ComponentRegistry

putComponent

public void putComponent(Object componentKey,
                         Object component)
Specified by:
putComponent in interface ComponentRegistry

contains

public boolean contains(Object componentKey)
Specified by:
contains in interface ComponentRegistry

getComponentInstance

public Object getComponentInstance(Object componentKey)
Specified by:
getComponentInstance in interface ComponentRegistry

getComponentInstanceKeys

public Set getComponentInstanceKeys()
Specified by:
getComponentInstanceKeys in interface ComponentRegistry

getComponentInstances

public Set getComponentInstances()
Specified by:
getComponentInstances in interface ComponentRegistry

hasComponentInstance

public boolean hasComponentInstance(Object componentKey)
Specified by:
hasComponentInstance in interface ComponentRegistry

getComponentSpec

public ComponentSpecification getComponentSpec(Object componentKey)
Specified by:
getComponentSpec in interface ComponentRegistry

findImplementingComponent

public Object findImplementingComponent(Class componentType)
                                 throws AmbiguousComponentResolutionException
Specified by:
findImplementingComponent in interface ComponentRegistry
Throws:
AmbiguousComponentResolutionException

findImplementingComponentSpecification

public ComponentSpecification findImplementingComponentSpecification(Class componentType)
                                                              throws AmbiguousComponentResolutionException
Specified by:
findImplementingComponentSpecification in interface ComponentRegistry
Throws:
AmbiguousComponentResolutionException

createComponent

public Object createComponent(ComponentSpecification componentSpecification)
                       throws PicoInitializationException
Specified by:
createComponent in interface ComponentRegistry
Throws:
PicoInitializationException


Copyright © 2003 Codehaus. All Rights Reserved.