org.apache.avalon.framework.component

Class DefaultComponentSelector

Implemented Interfaces:
ComponentSelector

public class DefaultComponentSelector
extends java.lang.Object
implements ComponentSelector

This is the default implementation of the ComponentSelector.

Deprecated: Use DefaultServiceSelector instead.

Version:
CVS $Revision: 1.23 $ $Date: 2004/02/11 14:34:25 $
Author:
Avalon Development Team

Method Summary

protected void
checkWriteable()
Check if this component m_manager is writeable.
protected Map
getComponentMap()
Helper method for subclasses to retrieve component map.
boolean
hasComponent(Object hint)
Returns whether a Component exists or not
void
makeReadOnly()
Make this component selector read-only.
void
put(Object hint, Component component)
Populate the ComponentSelector.
void
release(Component component)
Release component.
Component
select(Object hint)
Select the desired component.

Method Details

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.
Returns:
the component map

hasComponent

public boolean hasComponent(Object hint)
Returns whether a Component exists or not
Parameters:
hint - the hint to retrieve Component
Returns:
true if the Component exists

makeReadOnly

public void makeReadOnly()
Make this component selector read-only.

put

public void put(Object hint,
                Component component)
Populate the ComponentSelector.
Parameters:
hint - the hint to retrieve Component
component - the component to add

release

public void release(Component component)
Release component.
Parameters:
component - the component

select

public Component select(Object hint)
            throws ComponentException
Select the desired component. It does not cascade, neither should it.
Parameters:
hint - the hint to retrieve Component
Returns:
the Component