org.apache.cocoon.components.treeprocessor
Class TreeProcessor

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.components.treeprocessor.TreeProcessor
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, 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.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.logger.LogKitManageable, Processor, org.apache.avalon.excalibur.component.RoleManageable, org.apache.avalon.framework.thread.ThreadSafe

public class TreeProcessor
extends org.apache.avalon.framework.logger.AbstractLoggable
implements org.apache.avalon.framework.thread.ThreadSafe, Processor, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.excalibur.logger.LogKitManageable, org.apache.avalon.excalibur.component.RoleManageable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.activity.Disposable

Interpreted tree-traversal implementation of a pipeline assembly language.

Version:
CVS $Id: TreeProcessor.java,v 1.3 2002/03/17 21:55:22 sylvain Exp $
Author:
Sylvain Wallez

Field Summary
protected  ExtendedComponentSelector builderSelector
          Selector of TreeBuilders, the hint is the language name
protected  org.apache.avalon.framework.context.Context context
          The context
protected  org.apache.avalon.framework.configuration.Configuration currentLanguage
          The current language configuration
protected  java.util.List disposableNodes
          The list of processing nodes that should be disposed when disposing this processor
protected  java.lang.String language
          The language used by this processor
protected  long lastModified
          Last modification time
protected  long lastModifiedDelay
          Delay for sourceLastModified.
protected  org.apache.avalon.excalibur.logger.LogKitManager logKit
          The logkit manager to get Loggers
protected  org.apache.avalon.framework.component.ComponentManager manager
          The component manager
protected  TreeProcessor parent
          The parent TreeProcessor, if any
protected  org.apache.avalon.excalibur.component.RoleManager roleManager
          The role manager
protected  ProcessingNode rootNode
          The root node of the processing tree
protected  Source source
          The source of the tree definition
protected  SourceHandler sourceHandler
           
 
Fields inherited from interface org.apache.cocoon.Processor
ROLE
 
Constructor Summary
  TreeProcessor()
          Create a TreeProcessor.
protected TreeProcessor(TreeProcessor parent, org.apache.avalon.framework.component.ComponentManager manager, java.lang.String language)
          Create a child processor for a given language
 
Method Summary
 void compose(org.apache.avalon.framework.component.ComponentManager manager)
           
 void configure(org.apache.avalon.framework.configuration.Configuration config)
           
 void contextualize(org.apache.avalon.framework.context.Context context)
           
 TreeProcessor createChildProcessor(org.apache.avalon.framework.component.ComponentManager manager, java.lang.String language, Source source)
          Create a new child of this processor (used for mounting submaps).
 void dispose()
           
protected  void disposeTree()
          Dispose all nodes in the tree that are disposable
 void initialize()
           
 boolean process(Environment environment)
          Process the given Environment producing the output.
protected  boolean process(Environment environment, InvokeContext context)
           
 boolean process(Environment environment, StreamPipeline pipeline, EventPipeline eventPipeline)
          Process the given Environment to assemble a StreamPipeline and an EventPipeline.
 void setLogKitManager(org.apache.avalon.excalibur.logger.LogKitManager logKit)
           
 void setRoleManager(org.apache.avalon.excalibur.component.RoleManager rm)
           
protected  void setupRootNode(Environment env)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected TreeProcessor parent
The parent TreeProcessor, if any

context

protected org.apache.avalon.framework.context.Context context
The context

manager

protected org.apache.avalon.framework.component.ComponentManager manager
The component manager

logKit

protected org.apache.avalon.excalibur.logger.LogKitManager logKit
The logkit manager to get Loggers

roleManager

protected org.apache.avalon.excalibur.component.RoleManager roleManager
The role manager

language

protected java.lang.String language
The language used by this processor

builderSelector

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

rootNode

protected ProcessingNode rootNode
The root node of the processing tree

disposableNodes

protected java.util.List disposableNodes
The list of processing nodes that should be disposed when disposing this processor

lastModified

protected long lastModified
Last modification time

source

protected Source source
The source of the tree definition

lastModifiedDelay

protected long lastModifiedDelay
Delay for sourceLastModified.

currentLanguage

protected org.apache.avalon.framework.configuration.Configuration currentLanguage
The current language configuration

sourceHandler

protected SourceHandler sourceHandler
Constructor Detail

TreeProcessor

public TreeProcessor()
Create a TreeProcessor.

TreeProcessor

protected TreeProcessor(TreeProcessor parent,
                        org.apache.avalon.framework.component.ComponentManager manager,
                        java.lang.String language)
Create a child processor for a given language
Method Detail

createChildProcessor

public TreeProcessor createChildProcessor(org.apache.avalon.framework.component.ComponentManager manager,
                                          java.lang.String language,
                                          Source source)
                                   throws java.lang.Exception
Create a new child of this processor (used for mounting submaps).
Parameters:
manager - the component manager to be used by the child processor.
language - the language to be used by the child processor.
Returns:
a new child processor.

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable

compose

public void compose(org.apache.avalon.framework.component.ComponentManager manager)
             throws org.apache.avalon.framework.component.ComponentException
Specified by:
compose in interface org.apache.avalon.framework.component.Composable

setLogKitManager

public void setLogKitManager(org.apache.avalon.excalibur.logger.LogKitManager logKit)
Specified by:
setLogKitManager in interface org.apache.avalon.excalibur.logger.LogKitManageable

setRoleManager

public void setRoleManager(org.apache.avalon.excalibur.component.RoleManager rm)
Specified by:
setRoleManager in interface org.apache.avalon.excalibur.component.RoleManageable

configure

public void configure(org.apache.avalon.framework.configuration.Configuration config)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable

process

public boolean process(Environment environment)
                throws java.lang.Exception
Description copied from interface: Processor
Process the given Environment producing the output.
Specified by:
process in interface Processor
Following copied from interface: org.apache.cocoon.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

process

public boolean process(Environment environment,
                       StreamPipeline pipeline,
                       EventPipeline eventPipeline)
                throws java.lang.Exception
Description copied from interface: Processor
Process the given Environment to assemble a StreamPipeline and an EventPipeline.
Specified by:
process in interface Processor

process

protected boolean process(Environment environment,
                          InvokeContext context)
                   throws java.lang.Exception

setupRootNode

protected void setupRootNode(Environment env)
                      throws java.lang.Exception

dispose

public void dispose()
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable

disposeTree

protected void disposeTree()
Dispose all nodes in the tree that are disposable


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