|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.avalon.fortress.impl.lookup.FortressServiceSelector
This is the Default ServiceSelector for the Container. It provides a very simple abstraction, and makes it easy for the Container to manage the references.
| Constructor Summary | |
FortressServiceSelector(Container container,
java.lang.String key)
Creation of new service selector. |
|
| Method Summary | |
java.lang.String |
getKey()
|
boolean |
isSelectable(java.lang.Object hint)
Check to see if a Object exists relative to the supplied policy. |
void |
release(java.lang.Object component)
Return the Object when you are finished with it. |
java.lang.Object |
select(java.lang.Object hint)
Select the Object associated with the given policy. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FortressServiceSelector(Container container,
java.lang.String key)
container - the implkey - a key| Method Detail |
public java.lang.Object select(java.lang.Object hint)
throws ServiceException
ServiceSelectorObject 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 (...)
{
...
}
select in interface ServiceSelectorhint - A criteria against which a Object is selected.
Object value
ServiceException - If the requested Object cannot be suppliedpublic boolean isSelectable(java.lang.Object hint)
ServiceSelectorObject exists relative to the supplied policy.
isSelectable in interface ServiceSelectorhint - a Object containing the selection criteria
public void release(java.lang.Object component)
ServiceSelectorObject 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.
release in interface ServiceSelectorcomponent - The Object we are releasing, may also be a
null referencepublic java.lang.String getKey()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||