org.apache.cocoon.components.treeprocessor
Class TreeProcessor

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.treeprocessor.TreeProcessor
All Implemented Interfaces:
RoleManageable, Disposable, Component, Composable, Configurable, Contextualizable, LogEnabled, ThreadSafe, Processor

public class TreeProcessor
extends AbstractLogEnabled
implements ThreadSafe, Processor, Composable, Configurable, RoleManageable, Contextualizable, Disposable

Interpreted tree-traversal implementation of a pipeline assembly language.

Version:
CVS $Id: TreeProcessor.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Sylvain Wallez

Field Summary
protected  ExtendedComponentSelector builderSelector
          Selector of TreeBuilders, the hint is the language name
protected  boolean checkReload
          Check for reload?
static String COCOON_REDIRECT_ATTR
           
protected  Context context
          The context
protected  Configuration currentLanguage
          The current language configuration
protected  long lastModified
          Last modification time
protected  long lastModifiedDelay
          Delay for sourceLastModified.
protected  ComponentManager manager
          The component manager
protected  TreeProcessor parent
          The parent TreeProcessor, if any
protected  SourceResolver resolver
          The source resolver
protected  RoleManager roleManager
          The role manager
protected  DelayedRefreshSourceWrapper source
          The source of the tree definition
 
Fields inherited from interface org.apache.cocoon.Processor
ROLE
 
Constructor Summary
  TreeProcessor()
          Create a TreeProcessor.
protected TreeProcessor(TreeProcessor parent, ComponentManager manager)
          Create a child processor for a given language
 
Method Summary
 ProcessingPipeline buildPipeline(Environment environment)
          Process the given Environment to assemble a ProcessingPipeline.
 void compose(ComponentManager manager)
           
 void configure(Configuration config)
           
 void contextualize(Context context)
           
 TreeProcessor createChildProcessor(ComponentManager manager, String actualSource, boolean checkReload)
          Create a new child of this processor (used for mounting submaps).
 void dispose()
           
 Map getComponentConfigurations()
          Get the sitemap component configurations
 Processor getRootProcessor()
          Get the root processor parent of this processor.
 boolean process(Environment environment)
          Process the given Environment producing the output.
 void setComponentConfigurations(Configuration componentConfigurations)
          Set the sitemap component configurations
 void setRoleManager(RoleManager rm)
           
 String toString()
           
 
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, wait, wait, wait
 

Field Detail

COCOON_REDIRECT_ATTR

public static final String COCOON_REDIRECT_ATTR
See Also:
Constant Field Values

parent

protected TreeProcessor parent
The parent TreeProcessor, if any


context

protected Context context
The context


manager

protected ComponentManager manager
The component manager


roleManager

protected RoleManager roleManager
The role manager


builderSelector

protected ExtendedComponentSelector builderSelector
Selector of TreeBuilders, the hint is the language name


lastModified

protected long lastModified
Last modification time


source

protected DelayedRefreshSourceWrapper source
The source of the tree definition


lastModifiedDelay

protected long lastModifiedDelay
Delay for sourceLastModified.


currentLanguage

protected Configuration currentLanguage
The current language configuration


checkReload

protected boolean checkReload
Check for reload?


resolver

protected SourceResolver resolver
The source resolver

Constructor Detail

TreeProcessor

public TreeProcessor()
Create a TreeProcessor.


TreeProcessor

protected TreeProcessor(TreeProcessor parent,
                        ComponentManager manager)
Create a child processor for a given language

Method Detail

createChildProcessor

public TreeProcessor createChildProcessor(ComponentManager manager,
                                          String actualSource,
                                          boolean checkReload)
                                   throws Exception
Create a new child of this processor (used for mounting submaps).

Parameters:
manager - the component manager to be used by the child processor.
Returns:
a new child processor.
Throws:
Exception

contextualize

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

compose

public void compose(ComponentManager manager)
             throws ComponentException
Specified by:
compose in interface Composable
Throws:
ComponentException

setRoleManager

public void setRoleManager(RoleManager rm)
Specified by:
setRoleManager in interface RoleManageable

configure

public void configure(Configuration config)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Throws:
ConfigurationException

process

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

Specified by:
process in interface Processor
Returns:
If the processing is successfull true is returned. If not match is found in the sitemap false is returned.
Throws:
ResourceNotFoundException - If a sitemap component tries to access a resource which can not be found, e.g. the generator ConnectionResetException If the connection was reset
Exception

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

getRootProcessor

public Processor getRootProcessor()
Description copied from interface: Processor
Get the root processor parent of this processor.

Specified by:
getRootProcessor in interface Processor

setComponentConfigurations

public void setComponentConfigurations(Configuration componentConfigurations)
Set the sitemap component configurations


getComponentConfigurations

public Map getComponentConfigurations()
Description copied from interface: Processor
Get the sitemap component configurations

Specified by:
getComponentConfigurations in interface Processor

dispose

public void dispose()
Specified by:
dispose in interface Disposable

toString

public String toString()
Overrides:
toString in class Object


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