Class WrapperComponentManager
- java.lang.Object
-
- org.apache.avalon.framework.component.WrapperComponentManager
-
- All Implemented Interfaces:
org.apache.avalon.framework.component.ComponentManager
public class WrapperComponentManager extends java.lang.Object implements org.apache.avalon.framework.component.ComponentManagerThis is aComponentManagerimplementation that can wrap around aServiceManagerobject effectively adapting aServiceManagerinterface to aComponentManagerinterface.- Since:
- 4.1.4
- Version:
- $Id: WrapperComponentManager.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
- Author:
- Avalon Development Team
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.avalon.framework.service.ServiceManagerm_managerThe service manager we are adapting.
-
Constructor Summary
Constructors Constructor Description WrapperComponentManager(org.apache.avalon.framework.service.ServiceManager manager)Creation of a new wrapper component manger using a supplied service manager as a source backing the wrapped.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasComponent(java.lang.String key)Check to see if aComponentexists for a key.org.apache.avalon.framework.component.Componentlookup(java.lang.String key)Retrieve a component via a key.voidrelease(org.apache.avalon.framework.component.Component component)Return theComponentwhen you are finished with it.
-
-
-
Constructor Detail
-
WrapperComponentManager
public WrapperComponentManager(org.apache.avalon.framework.service.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 org.apache.avalon.framework.component.Component lookup(java.lang.String key) throws org.apache.avalon.framework.component.ComponentExceptionRetrieve a component via a key.- Specified by:
lookupin interfaceorg.apache.avalon.framework.component.ComponentManager- Parameters:
key- the key- Returns:
- the component
- Throws:
org.apache.avalon.framework.component.ComponentException- if unable to aquire component
-
hasComponent
public boolean hasComponent(java.lang.String key)
Check to see if aComponentexists for a key.- Specified by:
hasComponentin interfaceorg.apache.avalon.framework.component.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(org.apache.avalon.framework.component.Component component)
Return theComponentwhen you are finished with it. This allows theComponentManagerto 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:
releasein interfaceorg.apache.avalon.framework.component.ComponentManager- Parameters:
component- The Component we are releasing.
-
-