org.apache.avalon.framework.component
Class DefaultComponentSelector
java.lang.Object
|
+--org.apache.avalon.framework.component.DefaultComponentSelector
- All Implemented Interfaces:
- Component, ComponentSelector
- public class DefaultComponentSelector
- extends java.lang.Object
- implements ComponentSelector
This is the default implementation of the ComponentSelector
- Author:
- Berin Loritsch
Method Summary |
void |
put(java.lang.Object hint,
Component component)
Populate the ComponentSelector. |
void |
release(Component component)
Return the Component when you are finished with it. |
Component |
select(java.lang.Object hint)
Select the desired component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_components
protected final java.util.HashMap m_components
DefaultComponentSelector
public DefaultComponentSelector()
select
public Component select(java.lang.Object hint)
throws ComponentException
- Select the desired component. It does not cascade, neither
should it.
- Specified by:
select
in interface ComponentSelector
- Following copied from interface:
org.apache.avalon.framework.component.ComponentSelector
- Parameters:
name
- A hint to retrieve the correct Component
.- Throws:
ComponentNotFoundException
- If the given role is not associated
with a Component
.ComponentNotAccessibleException
- If a Component
instance cannot be created.
release
public void release(Component component)
- Description copied from interface:
ComponentSelector
- Return the
Component
when you are finished with it. This
allows the ComponentManager
to handle the End-Of-Life Lifecycle
events associated with the Component. Please note, that no Exceptions
should be thrown at this point. This is to allow easy use of the
ComponentManager system without having to trap Exceptions on a release.
- Specified by:
release
in interface ComponentSelector
- Following copied from interface:
org.apache.avalon.framework.component.ComponentSelector
- Parameters:
component
- The Component we are releasing.
put
public void put(java.lang.Object hint,
Component component)
- Populate the ComponentSelector.
Copyright © 2001 Apache Jakarta Project. All Rights Reserved.