org.apache.cocoon.components.treeprocessor
Class ConcreteTreeProcessor

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor
All Implemented Interfaces:
Disposable, org.apache.cocoon.sitemap.ExecutionContext, org.apache.cocoon.util.location.Locatable, org.apache.cocoon.Processor

public class ConcreteTreeProcessor
extends org.apache.cocoon.util.AbstractLogEnabled
implements org.apache.cocoon.Processor, Disposable, org.apache.cocoon.sitemap.ExecutionContext

The concrete implementation of Processor, containing the evaluation tree and associated data such as component manager.

Version:
$Id: ConcreteTreeProcessor.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  ClassLoader classLoader
          Classloader for this sitemap.
protected  Map processorAttributes
          Processor attributes
protected  WebApplicationContext webAppContext
          Container for this sitemap.
 
Fields inherited from interface org.apache.cocoon.Processor
ROLE
 
Constructor Summary
ConcreteTreeProcessor(TreeProcessor wrappingProcessor, org.apache.cocoon.sitemap.SitemapExecutor sitemapExecutor)
          Builds a concrete processig, given the wrapping processor
 
Method Summary
 org.apache.cocoon.Processor.InternalPipelineDescription buildPipeline(org.apache.cocoon.environment.Environment environment)
          Process the given Environment to assemble a ProcessingPipeline.
 void dispose()
           
 Object getAttribute(String name)
           
 String getContext()
           
 org.apache.cocoon.util.location.Location getLocation()
           
 org.apache.cocoon.Processor getParent()
           
 org.apache.cocoon.Processor getRootProcessor()
           
 ServiceManager getServiceManager()
           
 org.apache.cocoon.sitemap.SitemapExecutor getSitemapExecutor()
          Return the sitemap executor
 org.apache.cocoon.environment.SourceResolver getSourceResolver()
           
 String getType()
           
 TreeProcessor getWrappingProcessor()
           
protected  boolean handleCocoonRedirect(String uri, org.apache.cocoon.environment.Environment env, InvokeContext context)
           
 void markForDisposal()
          Mark this processor as needing to be disposed.
 boolean process(org.apache.cocoon.environment.Environment environment)
          Process the given Environment producing the output.
protected  boolean process(org.apache.cocoon.environment.Environment environment, InvokeContext context)
          Do the actual processing, be it producing the response or just building the pipeline
 Object removeAttribute(String name)
           
 void setAttribute(String name, Object value)
           
 void setProcessorData(WebApplicationContext webAppContext, ProcessingNode rootNode, List disposableNodes, List enterSitemapEventListeners, List leaveSitemapEventListeners)
          Set the processor data, result of the treebuilder job
 
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

processorAttributes

protected Map processorAttributes
Processor attributes


webAppContext

protected WebApplicationContext webAppContext
Container for this sitemap.


classLoader

protected ClassLoader classLoader
Classloader for this sitemap.

Constructor Detail

ConcreteTreeProcessor

public ConcreteTreeProcessor(TreeProcessor wrappingProcessor,
                             org.apache.cocoon.sitemap.SitemapExecutor sitemapExecutor)
Builds a concrete processig, given the wrapping processor

Method Detail

setProcessorData

public void setProcessorData(WebApplicationContext webAppContext,
                             ProcessingNode rootNode,
                             List disposableNodes,
                             List enterSitemapEventListeners,
                             List leaveSitemapEventListeners)
Set the processor data, result of the treebuilder job


markForDisposal

public void markForDisposal()
Mark this processor as needing to be disposed. Actual call to dispose() will occur when all request processings on this processor will be terminated.


getWrappingProcessor

public TreeProcessor getWrappingProcessor()

getRootProcessor

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

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

process

protected boolean process(org.apache.cocoon.environment.Environment environment,
                          InvokeContext context)
                   throws Exception
Do the actual processing, be it producing the response or just building the pipeline

Parameters:
environment -
context -
Returns:
true if the pipeline was successfully built, false otherwise.
Throws:
Exception

handleCocoonRedirect

protected boolean handleCocoonRedirect(String uri,
                                       org.apache.cocoon.environment.Environment env,
                                       InvokeContext context)
                                throws Exception
Throws:
Exception

dispose

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

getSourceResolver

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

getContext

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

getSitemapExecutor

public org.apache.cocoon.sitemap.SitemapExecutor getSitemapExecutor()
Return the sitemap executor


getServiceManager

public ServiceManager getServiceManager()

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)

getLocation

public org.apache.cocoon.util.location.Location getLocation()
Specified by:
getLocation in interface org.apache.cocoon.sitemap.ExecutionContext
See Also:
ExecutionContext.getLocation()

getType

public String getType()
Specified by:
getType in interface org.apache.cocoon.sitemap.ExecutionContext
See Also:
ExecutionContext.getType()

getParent

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


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