Class WrapperServiceSelector
java.lang.Object
org.apache.avalon.framework.service.WrapperServiceSelector
- All Implemented Interfaces:
ServiceSelector
This is a
ServiceSelector implementation that can wrap around a legacy
ComponentSelector object effectively adapting a ComponentSelector
interface to a ServiceSelector interface.
This class implements the Component interface because it is used in
environments which expect all components to implement Component.
- Since:
- 4.1.4
- Version:
- CVS $Revision: 1.10 $ $Date: 2004/02/11 14:34:26 $
- Author:
- Avalon Development Team
-
Constructor Summary
ConstructorsConstructorDescriptionWrapperServiceSelector(String key, ComponentSelector selector) This constructor is a constructor for a ComponentServiceManager -
Method Summary
-
Constructor Details
-
WrapperServiceSelector
This constructor is a constructor for a ComponentServiceManager- Parameters:
key- the key used to aquire this selectorselector- the selector to wrap
-
-
Method Details
-
select
Select a service based on a policy.- Specified by:
selectin interfaceServiceSelector- Parameters:
policy- the policy- Returns:
- the service
- Throws:
ServiceException- if unable to select service
-
isSelectable
Check to see if aObjectexists relative to the supplied policy.- Specified by:
isSelectablein interfaceServiceSelector- 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.- Specified by:
releasein interfaceServiceSelector- Parameters:
object- TheObjectwe are releasing.
-