org.apache.cocoon
Class Cocoon

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.Cocoon
All Implemented Interfaces:
Contextualizable, Disposable, Initializable, LogEnabled, Modifiable, Processor, Serviceable, ThreadSafe

public class Cocoon
extends AbstractLogEnabled
implements ThreadSafe, Initializable, Disposable, Modifiable, Processor, Contextualizable, Serviceable

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

Version:
CVS $Id: Cocoon.java 312930 2005-10-11 18:13:35Z cziegeler $
Author:
Pierpaolo Fumagalli (Apache Software Foundation), Stefano Mazzocchi, Leo Sutic

Nested Class Summary
 
Nested classes inherited from class org.apache.cocoon.Processor
Processor.InternalPipelineDescription
 
Field Summary
protected  Core core
          The Cocoon Core
protected  EnvironmentHelper environmentHelper
          The environment helper
protected  Map processorAttributes
          Processor attributes
protected  RequestListener requestListener
          An optional Avalon Component that is called before and after processing all requests.
protected  CocoonServiceManager serviceManager
          A service manager
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
 Processor.InternalPipelineDescription buildPipeline(Environment environment)
          Process the given Environment to assemble a ProcessingPipeline.
 void contextualize(Context context)
           
protected  void debug(Environment environment, boolean internal)
          Log debug information about the current environment.
 void dispose()
           
 void enableLogging(Logger logger)
           
 int getActiveRequestCount()
          Accessor for active request count
 Object getAttribute(String name)
          Gets an attribute
 Configuration[] getComponentConfigurations()
          Get the sitemap component configurations
 String getContext()
          Get the context URI for this processor
 Processor getRootProcessor()
          Return this (Cocoon is always at the root of the processing chain).
 ServiceManager getServiceManager()
          FIXME - Do we really need this method?
 SourceResolver getSourceResolver()
          Get the source resolver for this processor
static String getSystemProperty(String property, String value)
          Helper method to retrieve system property.
 void initialize()
           
 boolean modifiedSince(long date)
          Queries the class to estimate its ergodic period termination.
 boolean process(Environment environment)
          Process the given Environment producing the output.
 Object removeAttribute(String name)
          Remove an attribute.
 void service(ServiceManager manager)
          Get the parent service manager.
 void setAttribute(String name, Object value)
          Sets an attribute
 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


environmentHelper

protected EnvironmentHelper environmentHelper
The environment helper


serviceManager

protected CocoonServiceManager serviceManager
A service manager


requestListener

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


core

protected Core core
The Cocoon Core


processorAttributes

protected Map processorAttributes
Processor attributes

Constructor Detail

Cocoon

public Cocoon()
Creates a new Cocoon instance.

Method Detail

enableLogging

public void enableLogging(Logger logger)
Specified by:
enableLogging in interface LogEnabled
See Also:
LogEnabled.enableLogging(org.apache.avalon.framework.logger.Logger)

service

public void service(ServiceManager manager)
             throws ServiceException
Get the parent service manager. For purposes of avoiding extra method calls, the manager parameter may be null.

Specified by:
service in interface Serviceable
Parameters:
manager - the parent component manager. May be null
Throws:
ServiceException

contextualize

public void contextualize(Context context)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
Throws:
ContextException

setLoggerManager

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

Parameters:
loggerManager - a LoggerManager value

initialize

public void initialize()
                throws Exception
Specified by:
initialize in interface Initializable
Throws:
Exception

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()
Specified by:
dispose in interface Disposable
See Also:
Disposable.dispose()

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
Description copied from interface: Processor
Process the given Environment producing the output.

Specified by:
process in interface Processor
Returns:
If the processing is successfull true is returned. If no match is found in the sitemap false is returned.
Throws:
Exception

buildPipeline

public Processor.InternalPipelineDescription buildPipeline(Environment environment)
                                                    throws Exception
Description copied from interface: Processor
Process the given Environment to assemble a ProcessingPipeline. Don't forget to release the pipeline using Processor.InternalPipelineDescription.release().

Specified by:
buildPipeline in interface Processor
Throws:
Exception

getComponentConfigurations

public Configuration[] getComponentConfigurations()
Description copied from interface: Processor
Get the sitemap component configurations

Specified by:
getComponentConfigurations in interface Processor

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


getSourceResolver

public SourceResolver getSourceResolver()
Description copied from interface: Processor
Get the source resolver for this processor

Specified by:
getSourceResolver in interface Processor

getContext

public String getContext()
Description copied from interface: Processor
Get the context URI for this processor

Specified by:
getContext in interface Processor

getServiceManager

public ServiceManager getServiceManager()
FIXME - Do we really need this method?


getAttribute

public Object getAttribute(String name)
Description copied from interface: Processor
Gets an attribute

Specified by:
getAttribute in interface Processor
See Also:
Processor.getAttribute(java.lang.String)

removeAttribute

public Object removeAttribute(String name)
Description copied from interface: Processor
Remove an attribute.

Specified by:
removeAttribute in interface Processor
See Also:
Processor.removeAttribute(java.lang.String)

setAttribute

public void setAttribute(String name,
                         Object value)
Description copied from interface: Processor
Sets an attribute

Specified by:
setAttribute in interface Processor
See Also:
Processor.setAttribute(java.lang.String, java.lang.Object)


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