Class DefaultComponentSelector
java.lang.Object
org.apache.avalon.framework.component.DefaultComponentSelector
- All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.ComponentSelector
public class DefaultComponentSelector
extends Object
implements org.apache.avalon.framework.component.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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidCheck if this component m_manager is writeable.protected final MapHelper method for subclasses to retrieve component map.booleanhasComponent(Object hint) Returns whether a Component exists or notvoidMake this component selector read-only.voidPopulate the ComponentSelector.voidrelease(org.apache.avalon.framework.component.Component component) Release component.org.apache.avalon.framework.component.ComponentSelect the desired component.
-
Field Details
-
m_components
-
m_readOnly
private boolean m_readOnly
-
-
Constructor Details
-
DefaultComponentSelector
public DefaultComponentSelector()
-
-
Method Details
-
select
public org.apache.avalon.framework.component.Component select(Object hint) throws org.apache.avalon.framework.component.ComponentException Select the desired component. It does not cascade, neither should it.- Specified by:
selectin interfaceorg.apache.avalon.framework.component.ComponentSelector- Parameters:
hint- the hint to retrieve Component- Returns:
- the Component
- Throws:
org.apache.avalon.framework.component.ComponentException- if an error occurs
-
hasComponent
Returns whether a Component exists or not- Specified by:
hasComponentin interfaceorg.apache.avalon.framework.component.ComponentSelector- Parameters:
hint- the hint to retrieve Component- Returns:
trueif the Component exists
-
release
public void release(org.apache.avalon.framework.component.Component component) Release component.- Specified by:
releasein interfaceorg.apache.avalon.framework.component.ComponentSelector- Parameters:
component- the component
-
put
Populate the ComponentSelector.- Parameters:
hint- the hint to retrieve Componentcomponent- the component to add
-
getComponentMap
Helper method for subclasses to retrieve component map.- Returns:
- the component map
-
makeReadOnly
public void makeReadOnly()Make this component selector read-only. -
checkWriteable
Check if this component m_manager is writeable.- Throws:
IllegalStateException- if this component m_manager is read-only
-