org.apache.cocoon
Class Cocoon

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.Cocoon
All Implemented Interfaces:
Disposable, Initializable, Component, Composable, Contextualizable, LogEnabled, ThreadSafe, Modifiable, Processor, InstrumentManageable

public class Cocoon
extends AbstractLogEnabled
implements ThreadSafe, Component, Initializable, Disposable, Modifiable, Processor, Contextualizable, Composable, InstrumentManageable

The Cocoon Object is the main Kernel for the entire Cocoon system.

Version:
CVS $Id: Cocoon.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Pierpaolo Fumagalli (Apache Software Foundation), Stefano Mazzocchi, Leo Sutic

Field Summary
protected  RequestListener requestListener
          An optional Avalon Component that is called before and after processing all requests.
protected  SourceResolver sourceResolver
          The source resolver
 
Fields inherited from interface org.apache.cocoon.Processor
ROLE
 
Constructor Summary
Cocoon()
          Creates a new Cocoon instance.
 
Method Summary
 ProcessingPipeline buildPipeline(Environment environment)
          Process the given Environment to assemble a ProcessingPipeline.
 void compose(ComponentManager manager)
          Get the parent component manager.
 void configure(ExcaliburComponentManager startupManager)
          Configure this Cocoon instance.
 void contextualize(Context context)
          Describe contextualize method here.
protected  SourceResolver createSourceResolver(Logger logger)
          Create a simple source resolver.
protected  void debug(Environment environment, boolean internal)
          Log debug information about the current environment.
 void dispose()
          Dispose this instance
 void enableLogging(Logger logger)
           
 int getActiveRequestCount()
          Accessor for active request count
 Map getComponentConfigurations()
          Get the sitemap component configurations
 ExcaliburComponentManager getComponentManager()
           
 Processor getRootProcessor()
          Return this (Cocoon is always at the root of the processing chain).
static String getSystemProperty(String property, String value)
          Helper method to retrieve system property.
 void initialize()
          The initialize method
 boolean modifiedSince(long date)
          Queries the class to estimate its ergodic period termination.
 boolean process(Environment environment)
          Process the given Environment to produce the output.
 void setInstrumentManager(InstrumentManager manager)
          Set the InstrumentManager for this Cocoon instance.
 void setLoggerManager(LoggerManager loggerManager)
          The setLoggerManager method will get a LoggerManager for further use.
protected  void setSystemProperties()
          Sets required system properties.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sourceResolver

protected SourceResolver sourceResolver
The source resolver


requestListener

protected RequestListener requestListener
An optional Avalon Component that is called before and after processing all requests.

Constructor Detail

Cocoon

public Cocoon()
       throws ConfigurationException
Creates a new Cocoon instance.

Throws:
ConfigurationException - if an error occurs
Method Detail

enableLogging

public void enableLogging(Logger logger)
Specified by:
enableLogging in interface LogEnabled
Overrides:
enableLogging in class AbstractLogEnabled

compose

public void compose(ComponentManager manager)
             throws ComponentException
Get the parent component manager. For purposes of avoiding extra method calls, the manager parameter may be null.

Specified by:
compose in interface Composable
Parameters:
manager - the parent component manager. May be null
Throws:
ComponentException

contextualize

public void contextualize(Context context)
                   throws ContextException
Describe contextualize method here.

Specified by:
contextualize in interface Contextualizable
Parameters:
context - a Context value
Throws:
ContextException - if an error occurs

setLoggerManager

public void setLoggerManager(LoggerManager loggerManager)
The setLoggerManager method will get a LoggerManager for further use.

Parameters:
loggerManager - a LoggerManager value

setInstrumentManager

public void setInstrumentManager(InstrumentManager manager)
Set the InstrumentManager for this Cocoon instance.

Specified by:
setInstrumentManager in interface InstrumentManageable
Parameters:
manager - an InstrumentManager instance

initialize

public void initialize()
                throws Exception
The initialize method

Specified by:
initialize in interface Initializable
Throws:
Exception - if an error occurs

configure

public void configure(ExcaliburComponentManager startupManager)
               throws ConfigurationException,
                      ContextException
Configure this Cocoon instance.

Parameters:
startupManager - an ExcaliburComponentManager value
Throws:
ConfigurationException - if an error occurs
ContextException - if an error occurs

modifiedSince

public boolean modifiedSince(long date)
Queries the class to estimate its ergodic period termination.

Specified by:
modifiedSince in interface Modifiable
Parameters:
date - a long value
Returns:
a boolean value

getSystemProperty

public static String getSystemProperty(String property,
                                       String value)
Helper method to retrieve system property. Returns default value if SecurityException is caught.


setSystemProperties

protected void setSystemProperties()
Sets required system properties.


dispose

public void dispose()
Dispose this instance

Specified by:
dispose in interface Disposable

debug

protected void debug(Environment environment,
                     boolean internal)
Log debug information about the current environment.

Parameters:
environment - an Environment value

process

public boolean process(Environment environment)
                throws Exception
Process the given Environment to produce the output.

Specified by:
process in interface Processor
Parameters:
environment - an Environment value
Returns:
a boolean value
Throws:
Exception - if an error occurs

buildPipeline

public ProcessingPipeline buildPipeline(Environment environment)
                                 throws Exception
Process the given Environment to assemble a ProcessingPipeline.

Specified by:
buildPipeline in interface Processor
Throws:
Exception
Since:
2.1

getComponentConfigurations

public Map getComponentConfigurations()
Get the sitemap component configurations

Specified by:
getComponentConfigurations in interface Processor
Since:
2.1

getRootProcessor

public Processor getRootProcessor()
Return this (Cocoon is always at the root of the processing chain).

Specified by:
getRootProcessor in interface Processor
Since:
2.1.1

getActiveRequestCount

public int getActiveRequestCount()
Accessor for active request count


getComponentManager

public ExcaliburComponentManager getComponentManager()

createSourceResolver

protected SourceResolver createSourceResolver(Logger logger)
                                       throws ContextException
Create a simple source resolver.

Throws:
ContextException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.