org.apache.avalon.framework.service

Class WrapperServiceManager

public class WrapperServiceManager extends Object implements ServiceManager

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

Since: 4.1.4

Version: $Id: WrapperServiceManager.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $

Author: Avalon Development Team

Field Summary
ComponentManagerm_componentManager
The component manager thaty this class wraps.
Constructor Summary
WrapperServiceManager(ComponentManager componentManager)
This constructor is a constructor for a WrapperServiceManager.
Method Summary
booleanhasService(String key)
Return true if the component is available in ServiceManager.
Objectlookup(String key)
Retrieve a service using specified key.
voidrelease(Object service)
Release the service back to the ServiceManager.

Field Detail

m_componentManager

private final ComponentManager m_componentManager
The component manager thaty this class wraps.

Constructor Detail

WrapperServiceManager

public WrapperServiceManager(ComponentManager componentManager)
This constructor is a constructor for a WrapperServiceManager.

Parameters: componentManager the ComponentManager instance that is being wrapped

Method Detail

hasService

public boolean hasService(String key)
Return true if the component is available in ServiceManager.

Parameters: key the lookup

Returns: true if the component is available in ServiceManager

lookup

public Object lookup(String key)
Retrieve a service using specified key.

Parameters: key the key to use to lookup component

Returns: the matching service

Throws: ServiceException if unable to provide the service

See Also: ServiceManager#lookup

release

public void release(Object service)
Release the service back to the ServiceManager.

Parameters: service the service