Class DefaultServiceSelector
java.lang.Object
org.apache.avalon.framework.service.DefaultServiceSelector
- All Implemented Interfaces:
ServiceSelector
This is the default implementation of the ServiceSelector
- Version:
- CVS $Revision: 1.16 $ $Date: 2004/02/11 14:34:26 $
- Author:
- Avalon Development Team
-
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.
-
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 interfaceServiceSelector- Parameters:
hint- the hint to retrieve Object- Returns:
- the Object
- Throws:
ServiceException- if an error occurs
-
isSelectable
Returns whether a Object exists or not- Specified by:
isSelectablein interfaceServiceSelector- Parameters:
hint- the hint to retrieve Object- Returns:
trueif the Object exists
-
release
Release object.- Specified by:
releasein interfaceServiceSelector- Parameters:
object- theObjectto release
-
put
Populate the ServiceSelector.- Parameters:
hint- the hint to be used to retrieve the Object laterobject- the Object to hold
-
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
-