org.apache.avalon.framework.service
public interface ServiceSelector
ServiceSelector selects Objects based on a
supplied policy. The contract is that all the Objects implement the
same role.
Version: $Id: ServiceSelector.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
See Also: Serviceable ServiceSelector
| Method Summary | |
|---|---|
| boolean | isSelectable(Object policy)
Check to see if a Object exists relative to the supplied policy.
|
| void | release(Object object)
Return the Object when you are finished with it. |
| Object | select(Object policy)
Select the Object associated with the given policy.
|
Parameters: policy a Object containing the selection criteria
Returns: True if the component is available, False if it not.
Parameters: object The Object we are releasing, may also be a
null reference
Generator 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 a Object is selected.
Returns: an Object value
Throws: ServiceException If the requested Object cannot be supplied