org.apache.cocoon.components.treeprocessor
Class TreeProcessor

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.components.treeprocessor.TreeProcessor
All Implemented Interfaces:
Configurable, Disposable, Initializable, org.apache.cocoon.Processor, Serviceable, ThreadSafe

public class TreeProcessor
extends org.apache.cocoon.util.AbstractLogEnabled
implements ThreadSafe, org.apache.cocoon.Processor, Serviceable, Configurable, Disposable, Initializable

Interpreted tree-traversal implementation of a pipeline assembly language.

Version:
$Id: TreeProcessor.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Nested Class Summary
 
Nested classes inherited from class org.apache.cocoon.Processor
org.apache.cocoon.Processor.InternalPipelineDescription
 
Field Summary
protected  boolean checkReload
          Check for reload?
protected  boolean classReload
          Need component classes to be reloaded, due to jci notification?
protected  ConcreteTreeProcessor concreteProcessor
          The actual processor
protected  long lastModified
          Last modification time
protected  long lastModifiedDelay
          Delay for sourceLastModified.
protected  ServiceManager manager
          The component manager given by the upper level (root manager or parent concrete processor)
protected  TreeProcessor parent
          The parent TreeProcessor, if any
protected  SourceResolver resolver
          The source resolver
protected  org.apache.cocoon.configuration.Settings settings
          The settings.
protected  javax.xml.validation.Schema sitemapSchema
          The sitemap schema used for validation.
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, DelayedRefreshSourceWrapper sitemapSource, boolean checkReload, String prefix)
          Create a child processor for a given language
 
Method Summary
 org.apache.cocoon.Processor.InternalPipelineDescription buildPipeline(org.apache.cocoon.environment.Environment environment)
          Process the given Environment to assemble a ProcessingPipeline.
 void configure(Configuration config)
          Configure the tree processor: <processor file="{Location of the sitemap}" check-reload="{true|false}" config="{Location of sitemap tree processor config}> <reload delay="10"/> </processor> Only the file attribute is required; everything else is optional.
 TreeProcessor createChildProcessor(String src, boolean configuredCheckReload, String prefix)
          Create a new child of this processor (used for mounting submaps).
 void dispose()
           
 Object getAttribute(String name)
           
 String getContext()
           
 EnvironmentHelper getEnvironmentHelper()
          The current environment helper used by the MountNode
 org.apache.cocoon.Processor getParent()
           
 org.apache.cocoon.Processor getRootProcessor()
           
 org.apache.cocoon.environment.SourceResolver getSourceResolver()
           
 void handleNotification()
           
 void initialize()
           
 boolean process(org.apache.cocoon.environment.Environment environment)
          Process the given Environment producing the output.
 Object removeAttribute(String name)
           
 void service(ServiceManager serviceManager)
           
 void setAttribute(String name, Object value)
           
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
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


manager

protected ServiceManager manager
The component manager given by the upper level (root manager or parent concrete processor)


settings

protected org.apache.cocoon.configuration.Settings settings
The settings.


lastModified

protected long lastModified
Last modification time


source

protected DelayedRefreshSourceWrapper source
The source of the tree definition


lastModifiedDelay

protected long lastModifiedDelay
Delay for sourceLastModified.


checkReload

protected boolean checkReload
Check for reload?


classReload

protected boolean classReload
Need component classes to be reloaded, due to jci notification?


resolver

protected SourceResolver resolver
The source resolver


concreteProcessor

protected ConcreteTreeProcessor concreteProcessor
The actual processor


sitemapSchema

protected javax.xml.validation.Schema sitemapSchema
The sitemap schema used for validation.

Constructor Detail

TreeProcessor

public TreeProcessor()
Create a TreeProcessor.


TreeProcessor

protected TreeProcessor(TreeProcessor parent,
                        DelayedRefreshSourceWrapper sitemapSource,
                        boolean checkReload,
                        String prefix)
                 throws Exception
Create a child processor for a given language

Method Detail

createChildProcessor

public TreeProcessor createChildProcessor(String src,
                                          boolean configuredCheckReload,
                                          String prefix)
                                   throws Exception
Create a new child of this processor (used for mounting submaps).

Returns:
a new child processor.
Throws:
Exception

service

public void service(ServiceManager serviceManager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

initialize

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

configure

public void configure(Configuration config)
               throws ConfigurationException
Configure the tree processor: <processor file="{Location of the sitemap}" check-reload="{true|false}" config="{Location of sitemap tree processor config}> <reload delay="10"/> </processor> Only the file attribute is required; everything else is optional.

Specified by:
configure in interface Configurable
Throws:
ConfigurationException
See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)

process

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

Specified by:
process in 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:
org.apache.cocoon.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 org.apache.cocoon.Processor.InternalPipelineDescription buildPipeline(org.apache.cocoon.environment.Environment environment)
                                                                      throws Exception
Process the given Environment to assemble a ProcessingPipeline.

Specified by:
buildPipeline in interface org.apache.cocoon.Processor
Throws:
Exception
Since:
2.1

getRootProcessor

public org.apache.cocoon.Processor getRootProcessor()
Specified by:
getRootProcessor in interface org.apache.cocoon.Processor
See Also:
Processor.getRootProcessor()

getContext

public String getContext()
Specified by:
getContext in interface org.apache.cocoon.Processor
See Also:
Processor.getContext()

getSourceResolver

public org.apache.cocoon.environment.SourceResolver getSourceResolver()
Specified by:
getSourceResolver in interface org.apache.cocoon.Processor
See Also:
Processor.getSourceResolver()

getEnvironmentHelper

public EnvironmentHelper getEnvironmentHelper()
The current environment helper used by the MountNode

Returns:
EnvironmentHelper

dispose

public void dispose()
Specified by:
dispose in interface Disposable
See Also:
Disposable.dispose()

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface org.apache.cocoon.Processor
See Also:
Processor.getAttribute(java.lang.String)

removeAttribute

public Object removeAttribute(String name)
Specified by:
removeAttribute in interface org.apache.cocoon.Processor
See Also:
Processor.removeAttribute(java.lang.String)

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface org.apache.cocoon.Processor
See Also:
Processor.setAttribute(java.lang.String, java.lang.Object)

getParent

public org.apache.cocoon.Processor getParent()
Specified by:
getParent in interface org.apache.cocoon.Processor
See Also:
Processor.getParent()

handleNotification

public void handleNotification()


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