Interface ServiceSelector
- All Known Implementing Classes:
DefaultServiceSelector,WrapperServiceSelector
public interface ServiceSelector
A
ServiceSelector selects Objects based on a
supplied policy. The contract is that all the Objects 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 theObjectassociated with the given policy. For instance, If theServiceSelectorhas aGeneratorstored 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 aObjectis selected.- Returns:
- an
Objectvalue - Throws:
ServiceException- If the requestedObjectcannot be supplied
-
isSelectable
Check to see if aObjectexists relative to the supplied policy.- Parameters:
policy- aObjectcontaining the selection criteria- Returns:
- True if the component is available, False if it not.
-
release
Return theObjectwhen you are finished with it. This allows theServiceSelectorto 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- TheObjectwe are releasing, may also be anullreference
-