org.apache.cocoon.sitemap.impl
Class ComponentManager

java.lang.Object
  extended byorg.apache.cocoon.sitemap.impl.ComponentManager
All Implemented Interfaces:
ComponentLocator, ServiceManager

public class ComponentManager
extends Object
implements ServiceManager, ComponentLocator

This is the connection between the Cocoon core components and an optional application/sitemap container. It acts as a service manager and as a component locator at the same time. A component manager is initialized with both, a service manager for a sitemap and an optional component locator for the sitemap. Each operation (lookup etc.) is first performed on the component locator. If the locator does not have the component in question, the service manager is asked.

Since:
2.2
Version:
$Id: ComponentManager.java 171341 2005-05-22 16:35:41Z cziegeler $

Field Summary
protected  ComponentLocator componentLocator
           
protected  ServiceManager serviceManager
           
 
Constructor Summary
ComponentManager(ServiceManager sm, ComponentLocator cl)
           
 
Method Summary
protected  Object doLookup(String key)
           
 Object getComponent(String key)
           
 ServiceManager getServiceManager()
           
 boolean hasComponent(String key)
           
 boolean hasService(String key)
           
 Object lookup(String key)
           
 void release(Object component)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceManager

protected final ServiceManager serviceManager

componentLocator

protected final ComponentLocator componentLocator
Constructor Detail

ComponentManager

public ComponentManager(ServiceManager sm,
                        ComponentLocator cl)
Method Detail

hasService

public boolean hasService(String key)
Specified by:
hasService in interface ServiceManager
See Also:
ServiceManager.hasService(java.lang.String)

release

public void release(Object component)
Specified by:
release in interface ServiceManager
See Also:
ComponentLocator.release(java.lang.Object), ServiceManager.release(java.lang.Object)

hasComponent

public boolean hasComponent(String key)
Specified by:
hasComponent in interface ComponentLocator
See Also:
ComponentLocator.hasComponent(java.lang.String)

lookup

public Object lookup(String key)
              throws ServiceException
Specified by:
lookup in interface ServiceManager
Throws:
ServiceException
See Also:
ServiceManager.lookup(java.lang.String)

getComponent

public Object getComponent(String key)
                    throws ProcessingException
Specified by:
getComponent in interface ComponentLocator
Throws:
ProcessingException
See Also:
ComponentLocator.getComponent(java.lang.String)

doLookup

protected Object doLookup(String key)
                   throws ProcessingException,
                          ServiceException
Throws:
ProcessingException
ServiceException

getServiceManager

public ServiceManager getServiceManager()


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.