Top Description Fields Constructors Methods
org.apache.avalon.framework.component

public Class WrapperComponentManager

extends Object
implements ComponentManager
Class Inheritance
All Implemented Interfaces
org.apache.avalon.framework.component.ComponentManager
Imports
org.apache.avalon.framework.service.ServiceManager, .ServiceException, .ServiceSelector

This is a ComponentManager implementation that can wrap around a ServiceManager object effectively adapting a ServiceManager interface to a ComponentManager interface.
Author
Avalon Development Team
Since
4.1.4
Version
$Id: WrapperComponentManager.java 506231 2007-02-12 02:36:54Z crossley $

Field Summary

Modifier and TypeField and Description
private final ServiceManager
m_manager

The service manager we are adapting.

Constructor Summary

AccessConstructor and Description
public
WrapperComponentManager(final ServiceManager
the service manager backing the wrapper.
manager
)

Creation of a new wrapper component manger using a supplied service manager as a source backing the wrapped.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True if the component exists, False if it does not.
hasComponent
(final String
a string identifying the key to check.
key
)

Implements org.apache.avalon.framework.component.ComponentManager.hasComponent.

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

Returns:

the component
lookup
(final String
the key
key
)

Implements org.apache.avalon.framework.component.ComponentManager.lookup.

Retrieve a component via a key.
public void
release(final Component
The Component we are releasing.
component
)

Implements org.apache.avalon.framework.component.ComponentManager.release.

Return the Component when you are finished with it.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_managerback to summary
private final ServiceManager m_manager

The service manager we are adapting.

Constructor Detail

WrapperComponentManagerback to summary
public WrapperComponentManager(final 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:ServiceManager

the service manager backing the wrapper.

Method Detail

hasComponentback to summary
public boolean hasComponent(final String key)

Implements org.apache.avalon.framework.component.ComponentManager.hasComponent.

Check to see if a Component exists for a key.

Parameters
key:String

a string identifying the key to check.

Returns:boolean

True if the component exists, False if it does not.

lookupback to summary
public Component lookup(final String key) throws ComponentException

Implements org.apache.avalon.framework.component.ComponentManager.lookup.

Retrieve a component via a key.

Parameters
key:String

the key

Returns:Component

the component

Exceptions
ComponentException:
if unable to aquire component
releaseback to summary
public void release(final Component component)

Implements org.apache.avalon.framework.component.ComponentManager.release.

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.

Parameters
component:Component

The Component we are releasing.