Top Description Fields Constructors Methods
org.apache.avalon.framework.component

public Class DefaultComponentSelector

extends Object
implements ComponentSelector
Class Inheritance
All Implemented Interfaces
org.apache.avalon.framework.component.ComponentSelector, org.apache.avalon.framework.component.Component
Imports
java.util.HashMap, .Map

This is the default implementation of the ComponentSelector.

Deprecated: Use org.apache.avalon.framework.service.DefaultServiceSelector instead.

Author
Avalon Development Team
Version
$Id: DefaultComponentSelector.java 506231 2007-02-12 02:36:54Z crossley $

Field Summary

Modifier and TypeField and Description
private final HashMap<K, V>
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected final void
checkWriteable()

Check if this component m_manager is writeable.

protected final Map<K, V>

Returns:

the component map
getComponentMap
()

Helper method for subclasses to retrieve component map.

public boolean

Returns:

true if the Component exists
hasComponent
(final Object
the hint to retrieve Component
hint
)

Implements org.apache.avalon.framework.component.ComponentSelector.hasComponent.

Returns whether a Component exists or not
public void
makeReadOnly()

Make this component selector read-only.

public void
put(final Object
the hint to retrieve Component
hint
,
final Component
the component to add
component
)

Populate the ComponentSelector.

public void
release(final Component
the component
component
)

Implements org.apache.avalon.framework.component.ComponentSelector.release.

Release component.
public Component

Returns:

the Component
select
(Object
the hint to retrieve Component
hint
)

Implements org.apache.avalon.framework.component.ComponentSelector.select.

Select the desired component.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_componentsback to summary
private final HashMap<K, V> m_components
m_readOnlyback to summary
private boolean m_readOnly

Constructor Detail

DefaultComponentSelectorback to summary
public DefaultComponentSelector()

Method Detail

checkWriteableback to summary
protected final void checkWriteable() throws IllegalStateException

Check if this component m_manager is writeable.

Exceptions
IllegalStateException:
if this component m_manager is read-only
getComponentMapback to summary
protected final Map<K, V> getComponentMap()

Helper method for subclasses to retrieve component map.

Returns:Map<K, V>

the component map

hasComponentback to summary
public boolean hasComponent(final Object hint)

Implements org.apache.avalon.framework.component.ComponentSelector.hasComponent.

Returns whether a Component exists or not

Parameters
hint:Object

the hint to retrieve Component

Returns:boolean

true if the Component exists

makeReadOnlyback to summary
public void makeReadOnly()

Make this component selector read-only.

putback to summary
public void put(final Object hint, final Component component)

Populate the ComponentSelector.

Parameters
hint:Object

the hint to retrieve Component

component:Component

the component to add

releaseback to summary
public void release(final Component component)

Implements org.apache.avalon.framework.component.ComponentSelector.release.

Release component.

Parameters
component:Component

the component

selectback to summary
public Component select(Object hint) throws ComponentException

Implements org.apache.avalon.framework.component.ComponentSelector.select.

Select the desired component. It does not cascade, neither should it.

Parameters
hint:Object

the hint to retrieve Component

Returns:Component

the Component

Exceptions
ComponentException:
if an error occurs