org.picocontainer.defaults
Class DefaultComponentRegistry

java.lang.Object
  extended byorg.picocontainer.defaults.DefaultComponentRegistry
All Implemented Interfaces:
ComponentRegistry, Serializable

public class DefaultComponentRegistry
extends Object
implements ComponentRegistry, Serializable

The default component registry.

Version:
$Revision: 1.8 $
Author:
Aslak Hellesoy, Paul Hammant, various
See Also:
Serialized Form

Field Summary
protected  Map componentKeyToInstanceMap
           
protected  Map componentToSpec
           
protected  List orderedComponents
           
protected  List registeredComponentSpecifications
           
 
Constructor Summary
DefaultComponentRegistry()
           
 
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

registeredComponentSpecifications

protected final List registeredComponentSpecifications

orderedComponents

protected final List orderedComponents

componentKeyToInstanceMap

protected final Map componentKeyToInstanceMap

componentToSpec

protected final Map componentToSpec
Constructor Detail

DefaultComponentRegistry

public DefaultComponentRegistry()
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.