WrapperComponentSelector (Avalon Framework 4.1.5 API)
Keywords: org.apache.avalon.framework.component.WrapperComponentSelector class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.avalon.framework.component
Class WrapperComponentSelector

    java.lang.Object
      org.apache.avalon.framework.component.WrapperComponentSelector

All Implemented Interfaces:
  Component, ComponentSelector

public class WrapperComponentSelector
extends Object
implements ComponentSelector

This is a `ServiceSelector` implementation that can wrap around a legacy `ComponentSelector` object effectively adapting a `ComponentSelector` interface to a `ServiceSelector` interface.

Since:
  4.1.4
Version:
  CVS $Revision: 1.9 $ $Date: 2003/03/12 12:08:45 $
Author:
  Avalon Development Team

Constructor Summary
`WrapperComponentSelector(String key, ServiceSelector selector)` This constructor is a constructor for a WrapperComponentSelector.

Method Summary
`boolean` | `hasComponent(Object policy)` Check to see if a `Component` exists relative to the supplied policy.
`void` | `release(Component object)` Return the `Object` when you are finished with it.
`Component` | `select(Object policy)` Select a Component based on a policy.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### WrapperComponentSelector

    public WrapperComponentSelector(String key,
                                    ServiceSelector selector)

  This constructor is a constructor for a WrapperComponentSelector.

Parameters:
  `key` - the key used to aquire this selector
  `selector` - the selector to wrap

Method Detail

### select

    public Component select(Object policy)
                     throws ComponentException

  Select a Component based on a policy.

  Specified by:
    `select` in interface `ComponentSelector`
  Parameters:
    `policy` - the policy
  Returns:
    the Component
  Throws:
    `ComponentException` - if unable to select service

### hasComponent

    public boolean hasComponent(Object policy)

  Check to see if a `Component` exists relative to the supplied policy.

  Specified by:
    `hasComponent` in interface `ComponentSelector`
  Parameters:
    `policy` - a `Object` containing the selection criteria
  Returns:
    True if the component is available, False if it not.

### release

    public void release(Component object)

  Return the `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.

  Specified by:
    `release` in interface `ComponentSelector`
  Parameters:
    `object` - The `Object` we are releasing.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Apache Software Foundation. All Rights Reserved.