org.apache.cocoon.components
Class CocoonComponentManager

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLogEnabled
        |
        +--org.apache.avalon.excalibur.component.AbstractDualLogEnabled
              |
              +--org.apache.avalon.excalibur.component.ExcaliburComponentManager
                    |
                    +--org.apache.cocoon.components.CocoonComponentManager
All Implemented Interfaces:
org.apache.avalon.framework.component.ComponentManager, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable, org.apache.excalibur.instrument.Instrumentable, org.apache.excalibur.instrument.InstrumentManageable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.logger.LogKitManageable, org.apache.avalon.excalibur.component.RoleManageable

public final class CocoonComponentManager
extends org.apache.avalon.excalibur.component.ExcaliburComponentManager

Cocoon Component Manager. This manager extends the ExcaliburComponentManager by a special lifecycle handling for a RequestLifecycleComponent WARNING: This is a "private" Cocoon core class - do NOT use this class directly - and do not assume that a ComponentManager you get via the compose() method is an instance of CocoonComponentManager.

Version:
CVS $Id: CocoonComponentManager.java,v 1.13.2.9 2002/12/06 09:20:01 cziegeler Exp $
Author:
Carsten Ziegeler

Fields inherited from class org.apache.avalon.excalibur.component.ExcaliburComponentManager
INSTRUMENTABLE_NAME
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
CocoonComponentManager()
          Create the ComponentManager
CocoonComponentManager(java.lang.ClassLoader loader)
          Create the ComponentManager with a Classloader
CocoonComponentManager(org.apache.avalon.framework.component.ComponentManager manager)
          Create the ComponentManager with a parent ComponentManager
CocoonComponentManager(org.apache.avalon.framework.component.ComponentManager manager, java.lang.ClassLoader loader)
          Create the ComponentManager with a Classloader and parent ComponentManager
 
Method Summary
static void addComponentForAutomaticRelease(org.apache.avalon.framework.component.ComponentManager manager, org.apache.avalon.framework.component.Component component)
          Add an automatically released component
static void addComponentForAutomaticRelease(org.apache.avalon.framework.component.ComponentSelector selector, org.apache.avalon.framework.component.Component component, org.apache.avalon.framework.component.ComponentManager manager)
          Add an automatically released component
static void endProcessing(Environment env, java.lang.Object key)
          This hook has to be called before a request is processed.
static void enterEnvironment(Environment env, java.util.Map objectModel, Processor processor)
          This hook must be called by the sitemap each time a sitemap is entered
static Environment getCurrentEnvironment()
          Return the current environment (for the cocoon: protocol)
static EnvironmentStack getCurrentEnvironmentStack()
          Return the current environment stack (for the cocoon: protocol)
static Processor getCurrentProcessor()
          Return the current processor (for the cocoon: protocol)
static void leaveEnvironment()
          This hook must be called by the sitemap each time a sitemap is left
 org.apache.avalon.framework.component.Component lookup(java.lang.String role)
          Return an instance of a component based on a Role.
 void release(org.apache.avalon.framework.component.Component component)
          Release a Component.
static void removeFromAutomaticRelease(org.apache.avalon.framework.component.Component component)
          Remove from automatically released components
static java.lang.Object startProcessing(Environment env)
          This hook has to be called before a request is processed.
 
Methods inherited from class org.apache.avalon.excalibur.component.ExcaliburComponentManager
addComponent, addComponentInstance, configure, contextualize, dispose, getChildInstrumentables, getComponentHandler, getInstrumentableName, getInstruments, hasComponent, initialize, setInstrumentableName, setInstrumentManager, setLoggerManager, setLogKitManager, setRoleManager
 
Methods inherited from class org.apache.avalon.excalibur.component.AbstractDualLogEnabled
getLogkitLogger, setLogger
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CocoonComponentManager

public CocoonComponentManager()
Create the ComponentManager

CocoonComponentManager

public CocoonComponentManager(java.lang.ClassLoader loader)
Create the ComponentManager with a Classloader

CocoonComponentManager

public CocoonComponentManager(org.apache.avalon.framework.component.ComponentManager manager,
                              java.lang.ClassLoader loader)
Create the ComponentManager with a Classloader and parent ComponentManager

CocoonComponentManager

public CocoonComponentManager(org.apache.avalon.framework.component.ComponentManager manager)
Create the ComponentManager with a parent ComponentManager
Method Detail

enterEnvironment

public static void enterEnvironment(Environment env,
                                    java.util.Map objectModel,
                                    Processor processor)
This hook must be called by the sitemap each time a sitemap is entered

leaveEnvironment

public static void leaveEnvironment()
This hook must be called by the sitemap each time a sitemap is left

startProcessing

public static java.lang.Object startProcessing(Environment env)
This hook has to be called before a request is processed. The hook is called by the Cocoon component and by the cocoon protocol implementation.
Returns:
A unique key within this thread.

endProcessing

public static void endProcessing(Environment env,
                                 java.lang.Object key)
This hook has to be called before a request is processed. The hook is called by the Cocoon component and by the cocoon protocol implementation.
Parameters:
key - A unique key within this thread return by startProcessing(Environment).

getCurrentEnvironment

public static Environment getCurrentEnvironment()
Return the current environment (for the cocoon: protocol)

getCurrentProcessor

public static Processor getCurrentProcessor()
Return the current processor (for the cocoon: protocol)

getCurrentEnvironmentStack

public static EnvironmentStack getCurrentEnvironmentStack()
Return the current environment stack (for the cocoon: protocol)

lookup

public org.apache.avalon.framework.component.Component lookup(java.lang.String role)
                                                       throws org.apache.avalon.framework.component.ComponentException
Return an instance of a component based on a Role. The Role is usually the Interface's Fully Qualified Name(FQN)--unless there are multiple Components for the same Role. In that case, the Role's FQN is appended with "Selector", and we return a ComponentSelector.
Overrides:
lookup in class org.apache.avalon.excalibur.component.ExcaliburComponentManager

release

public void release(org.apache.avalon.framework.component.Component component)
Release a Component. This implementation makes sure it has a handle on the propper ComponentHandler, and let's the ComponentHandler take care of the actual work.
Overrides:
release in class org.apache.avalon.excalibur.component.ExcaliburComponentManager

addComponentForAutomaticRelease

public static void addComponentForAutomaticRelease(org.apache.avalon.framework.component.ComponentSelector selector,
                                                   org.apache.avalon.framework.component.Component component,
                                                   org.apache.avalon.framework.component.ComponentManager manager)
                                            throws ProcessingException
Add an automatically released component

addComponentForAutomaticRelease

public static void addComponentForAutomaticRelease(org.apache.avalon.framework.component.ComponentManager manager,
                                                   org.apache.avalon.framework.component.Component component)
                                            throws ProcessingException
Add an automatically released component

removeFromAutomaticRelease

public static void removeFromAutomaticRelease(org.apache.avalon.framework.component.Component component)
                                       throws ProcessingException
Remove from automatically released components


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.