Class WrapperComponentSelector
- java.lang.Object
-
- org.apache.avalon.framework.component.WrapperComponentSelector
-
- All Implemented Interfaces:
Component
,ComponentSelector
public class WrapperComponentSelector extends java.lang.Object implements ComponentSelector
This is aServiceSelector
implementation that can wrap around a legacyComponentSelector
object effectively adapting aComponentSelector
interface to aServiceSelector
interface.- Version:
- CVS $Revision: 1.8 $ $Date: 2003/02/11 07:13:45 $
- Author:
- Avalon Development Team
-
-
Constructor Summary
Constructors Constructor Description WrapperComponentSelector(java.lang.String key, ServiceSelector selector)
This constructor is a constructor for a WrapperComponentSelector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasComponent(java.lang.Object policy)
Check to see if aComponent
exists relative to the supplied policy.void
release(Component object)
Return theObject
when you are finished with it.Component
select(java.lang.Object policy)
Select a Component based on a policy.
-
-
-
Constructor Detail
-
WrapperComponentSelector
public WrapperComponentSelector(java.lang.String key, ServiceSelector selector)
This constructor is a constructor for a WrapperComponentSelector.- Parameters:
key
- the key used to aquire this selectorselector
- the selector to wrap
-
-
Method Detail
-
select
public Component select(java.lang.Object policy) throws ComponentException
Select a Component based on a policy.- Specified by:
select
in interfaceComponentSelector
- Parameters:
policy
- the policy- Returns:
- the Component
- Throws:
ComponentException
- if unable to select service
-
hasComponent
public boolean hasComponent(java.lang.Object policy)
Check to see if aComponent
exists relative to the supplied policy.- Specified by:
hasComponent
in interfaceComponentSelector
- Parameters:
policy
- aObject
containing the selection criteria- Returns:
- True if the component is available, False if it not.
-
release
public void release(Component object)
Return theObject
when you are finished with it. This allows theServiceSelector
to 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:
release
in interfaceComponentSelector
- Parameters:
object
- TheObject
we are releasing.
-
-