Interface ServiceSelector
- All Known Implementing Classes:
DefaultServiceSelector
,WrapperServiceSelector
public interface ServiceSelector
A
ServiceSelector
selects Object
s based on a
supplied policy. The contract is that all the Object
s implement the
same role.- Version:
- CVS $Revision: 1.16 $ $Date: 2004/02/11 14:34:25 $
- Author:
- Avalon Development Team
- See Also:
-
Method Summary
-
Method Details
-
select
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
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
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, may also be anull
reference
-