public class DefaultServiceSelector extends Object implements ServiceSelector
Constructor and Description |
---|
DefaultServiceSelector()
Create a DefaultServiceSelector with a default empty role.
|
DefaultServiceSelector(String role)
Create a DefaultServiceSelector with a role for debug purposes.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public DefaultServiceSelector()
public DefaultServiceSelector(String role)
role
- The role for this selector.NullPointerException
- if the role is null.public Object select(Object hint) throws ServiceException
select
in interface ServiceSelector
hint
- the hint to retrieve ObjectServiceException
- if an error occurspublic boolean isSelectable(Object hint)
isSelectable
in interface ServiceSelector
hint
- the hint to retrieve Objecttrue
if the Object existspublic void release(Object object)
release
in interface ServiceSelector
object
- the Object
to releasepublic void put(Object hint, Object object)
hint
- the hint to be used to retrieve the Object laterobject
- the Object to holdprotected final Map getObjectMap()
public void makeReadOnly()
protected final void checkWriteable() throws IllegalStateException
IllegalStateException
- if this service selector is read-onlyCopyright © 2024. All rights reserved.