Class DefaultComponentManager
java.lang.Object
org.apache.avalon.framework.component.DefaultComponentManager
- All Implemented Interfaces:
ComponentManager
This class is a static implementation of a ComponentManager. Allow ineritance
and extension so you can generate a tree of ComponentManager each defining
Component scope.
Deprecated:
Use DefaultServiceManager instead.
- Version:
- CVS $Revision: 1.26 $ $Date: 2004/02/11 14:34:25 $
- Author:
- Avalon Development Team
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct ComponentManager with no parent.Construct ComponentManager with specified parent. -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidCheck if this component m_manager is writeable.protected final MapHelper method for subclasses to retrieve component map.protected final ComponentManagerHelper method for subclasses to retrieve parent.booleanhasComponent(String key) Returnstrueif the component m_manager is managing a component with the specified key,falseotherwise.Retrieve Component by key from ComponentManager.voidMake this component m_manager read only.voidPlace Component into ComponentManager.voidRelease component.toString()Build a human readable representation of ComponentManager.
-
Constructor Details
-
DefaultComponentManager
public DefaultComponentManager()Construct ComponentManager with no parent. -
DefaultComponentManager
Construct ComponentManager with specified parent.- Parameters:
parent- the ComponentManagers parent
-
-
Method Details
-
lookup
Retrieve Component by key from ComponentManager.- Specified by:
lookupin interfaceComponentManager- Parameters:
key- the key- Returns:
- the Component
- Throws:
ComponentException- if an error occurs
-
hasComponent
Returnstrueif the component m_manager is managing a component with the specified key,falseotherwise.- Specified by:
hasComponentin interfaceComponentManager- Parameters:
key- key of the component you are lokking for- Returns:
trueif the component m_manager has a component with that key
-
put
Place Component into ComponentManager.- Parameters:
key- the components keycomponent- the component
-
release
Release component.- Specified by:
releasein interfaceComponentManager- Parameters:
component- the component
-
toString
Build a human readable representation of ComponentManager. -
getParent
Helper method for subclasses to retrieve parent.- Returns:
- the parent ComponentManager
-
getComponentMap
Helper method for subclasses to retrieve component map.- Returns:
- the component map
-
makeReadOnly
public void makeReadOnly()Make this component m_manager read only. -
checkWriteable
Check if this component m_manager is writeable.- Throws:
IllegalStateException- if this component m_manager is read-only
-