org.apache.avalon.framework.service
Class WrapperServiceManager

java.lang.Object
  extended by org.apache.avalon.framework.service.WrapperServiceManager
All Implemented Interfaces:
org.apache.avalon.framework.service.ServiceManager

public class WrapperServiceManager
extends java.lang.Object
implements org.apache.avalon.framework.service.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 506231 2007-02-12 02:36:54Z crossley $
Author:
Avalon Development Team

Constructor Summary
WrapperServiceManager(org.apache.avalon.framework.component.ComponentManager componentManager)
          This constructor is a constructor for a WrapperServiceManager.
 
Method Summary
 boolean hasService(java.lang.String key)
          Return true if the component is available in ServiceManager.
 java.lang.Object lookup(java.lang.String key)
          Retrieve a service using specified key.
 void release(java.lang.Object service)
          Release the service back to the ServiceManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrapperServiceManager

public WrapperServiceManager(org.apache.avalon.framework.component.ComponentManager componentManager)
This constructor is a constructor for a WrapperServiceManager.

Parameters:
componentManager - the ComponentManager instance that is being wrapped
Method Detail

lookup

public java.lang.Object lookup(java.lang.String key)
                        throws org.apache.avalon.framework.service.ServiceException
Retrieve a service using specified key.

Specified by:
lookup in interface org.apache.avalon.framework.service.ServiceManager
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

hasService

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

Specified by:
hasService in interface org.apache.avalon.framework.service.ServiceManager
Parameters:
key - the lookup
Returns:
true if the component is available in ServiceManager

release

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

Specified by:
release in interface org.apache.avalon.framework.service.ServiceManager
Parameters:
service - the service


Copyright © 1997-2009 Apache Software Foundation. All Rights Reserved.