|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.component.DefaultComponentManager
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.
Constructor Summary | |
DefaultComponentManager()
Construct ComponentManager with no parent. |
|
DefaultComponentManager(ComponentManager parent)
Construct ComponentManager with specified parent. |
Method Summary | |
protected void |
checkWriteable()
|
protected java.util.Map |
getComponentMap()
Helper method for subclasses to retrieve component map. |
protected ComponentManager |
getParent()
Helper method for subclasses to retrieve parent. |
boolean |
hasComponent(java.lang.String role)
Check to see if a Component exists for a role. |
Component |
lookup(java.lang.String role)
Retrieve Component by role from ComponentManager. |
void |
makeReadOnly()
|
void |
put(java.lang.String role,
Component component)
Place Component into ComponentManager. |
void |
release(Component component)
Release component. |
java.lang.String |
toString()
Build a human readable representation of ComponentManager. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DefaultComponentManager()
public DefaultComponentManager(ComponentManager parent)
parent
- the ComponentManagers parentMethod Detail |
public Component lookup(java.lang.String role) throws ComponentException
lookup
in interface ComponentManager
role
- the roleComponentException
- if an error occurspublic boolean hasComponent(java.lang.String role)
ComponentManager
Component
exists for a role.hasComponent
in interface ComponentManager
org.apache.avalon.framework.component.ComponentManager
role
- a string identifying the role to check.public void put(java.lang.String role, Component component)
role
- the components rolecomponent
- the componentpublic void release(Component component)
release
in interface ComponentManager
component
- the componentpublic java.lang.String toString()
toString
in class java.lang.Object
protected final ComponentManager getParent()
protected final java.util.Map getComponentMap()
public void makeReadOnly()
protected final void checkWriteable() throws java.lang.IllegalStateException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |