Interface ServiceSelector
-
- All Known Implementing Classes:
DefaultServiceSelector
,WrapperServiceSelector
public interface ServiceSelector
AServiceSelector
selectsObject
s based on a supplied policy. The contract is that all theObject
s implement the same role.- Version:
- CVS $Revision: 1.13 $ $Date: 2003/02/11 15:58:42 $
- Author:
- Avalon Development Team
- See Also:
Serviceable
,ServiceSelector
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isSelectable(java.lang.Object policy)
Check to see if aObject
exists relative to the supplied policy.void
release(java.lang.Object object)
Return theObject
when you are finished with it.java.lang.Object
select(java.lang.Object policy)
Select theObject
associated with the given policy.
-
-
-
Method Detail
-
select
java.lang.Object select(java.lang.Object policy) throws ServiceException
Select theObject
associated with the given policy. For instance, If theServiceSelector
has aGenerator
stored and referenced by a URL, the following call could be used:try { Generator input; input = (Generator)selector.select( new URL("foo://demo/url") ); } catch (...) { ... }
- Parameters:
policy
- A criteria against which aObject
is selected.- Returns:
- an
Object
value - Throws:
ServiceException
- If the requestedObject
cannot be supplied
-
isSelectable
boolean isSelectable(java.lang.Object policy)
Check to see if aObject
exists relative to the supplied policy.- Parameters:
policy
- aObject
containing the selection criteria- Returns:
- True if the component is available, False if it not.
-
release
void release(java.lang.Object object)
Return theObject
when you are finished with it. This allows theServiceSelector
to handle the End-Of-Life Lifecycle events associated with theObject
. Please note, that no Exception should be thrown at this point. This is to allow easy use of the ServiceSelector system without having to trap Exceptions on a release.- Parameters:
object
- TheObject
we are releasing.
-
-