org.apache.avalon.framework.component
Class DefaultComponentManager
java.lang.Object
org.apache.avalon.framework.component.DefaultComponentManager
- ComponentManager
public class DefaultComponentManager
extends java.lang.Object
implements 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.
CVS $Revision: 1.26 $ $Date: 2004/02/11 14:34:25 $
protected void | checkWriteable() - Check if this component m_manager is writeable.
|
protected Map | getComponentMap() - Helper method for subclasses to retrieve component map.
|
protected ComponentManager | getParent() - Helper method for subclasses to retrieve parent.
|
boolean | hasComponent(String key) - Returns
true if the component m_manager is managing a component
with the specified key, false otherwise.
|
Component | lookup(String key) - Retrieve Component by key from ComponentManager.
|
void | makeReadOnly() - Make this component m_manager read only.
|
void | put(String key, Component component) - Place Component into ComponentManager.
|
void | release(Component component) - Release component.
|
String | toString() - Build a human readable representation of ComponentManager.
|
DefaultComponentManager
public DefaultComponentManager()
Construct ComponentManager with no parent.
DefaultComponentManager
public DefaultComponentManager(ComponentManager parent)
Construct ComponentManager with specified parent.
parent
- the ComponentManagers parent
checkWriteable
protected final void checkWriteable()
throws IllegalStateException
Check if this component m_manager is writeable.
getComponentMap
protected final Map getComponentMap()
Helper method for subclasses to retrieve component map.
getParent
protected final ComponentManager getParent()
Helper method for subclasses to retrieve parent.
- the parent ComponentManager
hasComponent
public boolean hasComponent(String key)
Returns true
if the component m_manager is managing a component
with the specified key, false
otherwise.
key
- key of the component you are lokking for
true
if the component m_manager has a component with that key
lookup
public Component lookup(String key)
throws ComponentException
Retrieve Component by key from ComponentManager.
makeReadOnly
public void makeReadOnly()
Make this component m_manager read only.
put
public void put(String key,
Component component)
Place Component into ComponentManager.
key
- the components keycomponent
- the component
release
public void release(Component component)
Release component.
component
- the component
toString
public String toString()
Build a human readable representation of ComponentManager.
- the description of ComponentManager