org.apache.avalon.framework.service
public class DefaultServiceSelector extends Object implements ServiceSelector
Version: $Id: DefaultServiceSelector.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
| Field Summary | |
|---|---|
| HashMap | m_objects |
| boolean | m_readOnly |
| String | m_role |
| Constructor Summary | |
|---|---|
| DefaultServiceSelector()
Create a DefaultServiceSelector with a default empty role. | |
| DefaultServiceSelector(String role)
Create a DefaultServiceSelector with a role for debug purposes.
| |
| Method Summary | |
|---|---|
| protected void | checkWriteable()
Checks if this service selector is writeable.
|
| protected Map | getObjectMap()
Helper method for subclasses to retrieve object map.
|
| boolean | isSelectable(Object hint)
Returns whether a Object exists or not |
| void | makeReadOnly()
Makes this service selector read-only.
|
| void | put(Object hint, Object object)
Populate the ServiceSelector. |
| void | release(Object object)
Release object.
|
| Object | select(Object hint)
Select the desired object.
|
Parameters: role The role for this selector.
Throws: NullPointerException if the role is null.
Throws: IllegalStateException if this service selector is read-only
Returns: the object map
Parameters: hint the hint to retrieve Object
Returns: true if the Object exists
Parameters: hint the hint to be used to retrieve the Object later object the Object to hold
Parameters: object the Object to release
Parameters: hint the hint to retrieve Object
Returns: the Object
Throws: ServiceException if an error occurs