|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A ServiceSelector selects Objects based on a
supplied policy. The contract is that all the Objects implement the
same role.
Serviceable,
ServiceSelector| Method Summary | |
boolean |
isSelectable(java.lang.Object policy)
Check to see if a Object exists relative to the supplied policy. |
void |
release(java.lang.Object object)
Return the Object when you are finished with it. |
java.lang.Object |
select(java.lang.Object policy)
Select the Object associated with the given policy. |
| Method Detail |
public java.lang.Object select(java.lang.Object policy)
throws ServiceException
Object associated with the given policy.
For instance, If the ServiceSelector has a
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 (...)
{
...
}
policy - A criteria against which a Object is selected.
Object value
ServiceException - If the requested Object cannot be suppliedpublic boolean isSelectable(java.lang.Object policy)
Object exists relative to the supplied policy.
policy - a Object containing the selection criteria
public void release(java.lang.Object object)
Object when you are finished with it. This
allows the ServiceSelector to handle the End-Of-Life Lifecycle
events associated with the Object. 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.
object - The Object we are releasing, may also be a
null reference
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||