Class DefaultServiceSelector
java.lang.Object
org.apache.avalon.framework.service.DefaultServiceSelector
- All Implemented Interfaces:
org.apache.avalon.framework.service.ServiceSelector
public class DefaultServiceSelector
extends Object
implements org.apache.avalon.framework.service.ServiceSelector
This is the default implementation of the ServiceSelector
- Version:
- $Id: DefaultServiceSelector.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
- Author:
- Avalon Development Team
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a DefaultServiceSelector with a default empty role.DefaultServiceSelector(String role) Create a DefaultServiceSelector with a role for debug purposes. -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidChecks if this service selector is writeable.protected final MapHelper method for subclasses to retrieve object map.booleanisSelectable(Object hint) Returns whether a Object exists or notvoidMakes this service selector read-only.voidPopulate the ServiceSelector.voidRelease object.Select the desired object.
-
Field Details
-
m_objects
-
m_readOnly
private boolean m_readOnly -
m_role
-
-
Constructor Details
-
DefaultServiceSelector
public DefaultServiceSelector()Create a DefaultServiceSelector with a default empty role. -
DefaultServiceSelector
Create a DefaultServiceSelector with a role for debug purposes.- Parameters:
role- The role for this selector.- Throws:
NullPointerException- if the role is null.
-
-
Method Details
-
select
Select the desired object.- Specified by:
selectin interfaceorg.apache.avalon.framework.service.ServiceSelector- Parameters:
hint- the hint to retrieve Object- Returns:
- the Object
- Throws:
org.apache.avalon.framework.service.ServiceException- if an error occurs
-
isSelectable
Returns whether a Object exists or not- Specified by:
isSelectablein interfaceorg.apache.avalon.framework.service.ServiceSelector- Parameters:
hint- the hint to retrieve Object- Returns:
trueif the Object exists
-
release
Release object.- Specified by:
releasein interfaceorg.apache.avalon.framework.service.ServiceSelector- Parameters:
object- theObjectto release
-
put
-
getObjectMap
Helper method for subclasses to retrieve object map.- Returns:
- the object map
-
makeReadOnly
public void makeReadOnly()Makes this service selector read-only. -
checkWriteable
Checks if this service selector is writeable.- Throws:
IllegalStateException- if this service selector is read-only
-