|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.service.DefaultServiceSelector
This is the default implementation of the ServiceSelector
Constructor Summary | |
DefaultServiceSelector()
Create a DefaultServiceSelector with a default empty role. |
|
DefaultServiceSelector(java.lang.String role)
Create a DefaultServiceSelector with a role for debug purposes. |
Method Summary | |
protected void |
checkWriteable()
Checks if this service selector is writeable. |
protected java.util.Map |
getObjectMap()
Helper method for subclasses to retrieve object map. |
boolean |
isSelectable(java.lang.Object hint)
Returns whether a Object exists or not |
void |
makeReadOnly()
Makes this service selector read-only. |
void |
put(java.lang.Object hint,
java.lang.Object object)
Populate the ServiceSelector. |
void |
release(java.lang.Object object)
Release object. |
java.lang.Object |
select(java.lang.Object hint)
Select the desired object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultServiceSelector()
public DefaultServiceSelector(java.lang.String role)
role
- The role for this selector.
java.lang.NullPointerException
- if the role is null.Method Detail |
public java.lang.Object select(java.lang.Object hint) throws ServiceException
select
in interface ServiceSelector
hint
- the hint to retrieve Object
ServiceException
- if an error occurspublic boolean isSelectable(java.lang.Object hint)
isSelectable
in interface ServiceSelector
hint
- the hint to retrieve Object
true
if the Object existspublic void release(java.lang.Object object)
release
in interface ServiceSelector
object
- the Object
to releasepublic void put(java.lang.Object hint, java.lang.Object object)
hint
- the hint to be used to retrieve the Object laterobject
- the Object to holdprotected final java.util.Map getObjectMap()
public void makeReadOnly()
protected final void checkWriteable() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if this service selector is read-only
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |