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 java.lang.Object implements org.apache.avalon.framework.component.ComponentSelectorThis is the default implementation of the ComponentSelector.Deprecated: Use
DefaultServiceSelectorinstead.- Version:
- $Id: DefaultComponentSelector.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
- Author:
- Avalon Development Team
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashMapm_componentsprivate booleanm_readOnly
-
Constructor Summary
Constructors Constructor Description DefaultComponentSelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckWriteable()Check if this component m_manager is writeable.protected java.util.MapgetComponentMap()Helper method for subclasses to retrieve component map.booleanhasComponent(java.lang.Object hint)Returns whether a Component exists or notvoidmakeReadOnly()Make this component selector read-only.voidput(java.lang.Object hint, org.apache.avalon.framework.component.Component component)Populate the ComponentSelector.voidrelease(org.apache.avalon.framework.component.Component component)Release component.org.apache.avalon.framework.component.Componentselect(java.lang.Object hint)Select the desired component.
-
-
-
Method Detail
-
select
public org.apache.avalon.framework.component.Component select(java.lang.Object hint) throws org.apache.avalon.framework.component.ComponentExceptionSelect 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
public boolean hasComponent(java.lang.Object hint)
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
public void put(java.lang.Object hint, org.apache.avalon.framework.component.Component component)Populate the ComponentSelector.- Parameters:
hint- the hint to retrieve Componentcomponent- the component to add
-
getComponentMap
protected final java.util.Map getComponentMap()
Helper method for subclasses to retrieve component map.- Returns:
- the component map
-
makeReadOnly
public void makeReadOnly()
Make this component selector read-only.
-
checkWriteable
protected final void checkWriteable() throws java.lang.IllegalStateExceptionCheck if this component m_manager is writeable.- Throws:
java.lang.IllegalStateException- if this component m_manager is read-only
-
-