WrapperComponentManager (Avalon Framework 4.1.5 API)
Keywords: org.apache.avalon.framework.component.WrapperComponentManager 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 WrapperComponentManager

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

All Implemented Interfaces:
  ComponentManager

public class WrapperComponentManager
extends Object
implements ComponentManager

This is a `ComponentManager` implementation that can wrap around a `ServiceManager` object effectively adapting a `ServiceManager` interface to a `ComponentManager` interface.

Since:
  4.1.4
Version:
  CVS $Revision: 1.16 $ $Date: 2003/03/25 04:08:52 $
Author:
  Avalon Development Team

Constructor Summary
`WrapperComponentManager(ServiceManager manager)` Creation of a new wrapper component manger using a supplied service manager as a source backing the wrapped.

Method Summary
`boolean` | `hasComponent(String key)` Check to see if a `Component` exists for a key.
`Component` | `lookup(String key)` Retrieve a component via a key.
`void` | `release(Component component)` Return the `Component` when you are finished with it.

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

Constructor Detail

### WrapperComponentManager

    public WrapperComponentManager(ServiceManager manager)

  Creation of a new wrapper component manger using a supplied service manager as a source backing the wrapped. This implementation redirects lookup requests to the supplied service manager provided under this constructor. No attempt is made to proxy object supplied by the primary manager as Component instances - as such, it is the responsibility of the application establishing the wrapper to ensure that objects accessed via the primary manager implement the Component interface.

Parameters:
  `manager` - the service manager backing the wrapper.

Method Detail

### lookup

    public Component lookup(String key)
                     throws ComponentException

  Retrieve a component via a key.

  Specified by:
    `lookup` in interface `ComponentManager`
  Parameters:
    `key` - the key
  Returns:
    the component
  Throws:
    `ComponentException` - if unable to aquire component

### hasComponent

    public boolean hasComponent(String key)

  Check to see if a `Component` exists for a key.

  Specified by:
    `hasComponent` in interface `ComponentManager`
  Parameters:
    `key` - a string identifying the key to check.
  Returns:
    True if the component exists, False if it does not.

### release

    public void release(Component component)

  Return the `Component` when you are finished with it. This allows the `ComponentManager` to handle the End-Of-Life Lifecycle events associated with the Component. Please note, that no Exceptions should be thrown at this point. This is to allow easy use of the ComponentManager system without having to trap Exceptions on a release.

  Specified by:
    `release` in interface `ComponentManager`
  Parameters:
    `component` - The Component 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.