org.apache.avalon.framework.component

Class DefaultComponentSelector

public class DefaultComponentSelector extends Object implements ComponentSelector

This is the default implementation of the ComponentSelector.

Deprecated: Use DefaultServiceSelector instead.

Version: $Id: DefaultComponentSelector.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $

Author: Avalon Development Team

Field Summary
HashMapm_components
booleanm_readOnly
Method Summary
protected voidcheckWriteable()
Check if this component m_manager is writeable.
protected MapgetComponentMap()
Helper method for subclasses to retrieve component map.
booleanhasComponent(Object hint)
Returns whether a Component exists or not
voidmakeReadOnly()
Make this component selector read-only.
voidput(Object hint, Component component)
Populate the ComponentSelector.
voidrelease(Component component)
Release component.
Componentselect(Object hint)
Select the desired component.

Field Detail

m_components

private final HashMap m_components

m_readOnly

private boolean m_readOnly

Method Detail

checkWriteable

protected final void checkWriteable()
Check if this component m_manager is writeable.

Throws: IllegalStateException if this component m_manager is read-only

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)
Select the desired component. It does not cascade, neither should it.

Parameters: hint the hint to retrieve Component

Returns: the Component

Throws: ComponentException if an error occurs