org.apache.cocoon.components.treeprocessor
Class InvokeContext

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.treeprocessor.InvokeContext
All Implemented Interfaces:
Disposable, Composable, Recomposable, LogEnabled

public class InvokeContext
extends AbstractLogEnabled
implements Recomposable, Disposable

The invocation context of ProcessingNodes.

This class serves two purposes:

Version:
$Id: InvokeContext.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Sylvain Wallez, Carsten Ziegeler, Torsten Curdt

Field Summary
protected  SitemapErrorHandler errorHandler
          The error handler for the pipeline.
protected  ComponentSelector pipelineSelector
          The Selector for the processing pipeline
protected  ProcessingPipeline processingPipeline
          The ProcessingPipeline used
protected  String processingPipelineName
          The name of the processing pipeline component
protected  Map processingPipelineObjectModel
          The object model used to resolve processingPipelineParameters
protected  Map processingPipelineParameters
          The parameters for the processing pipeline
protected  Redirector redirector
          The redirector
 
Constructor Summary
InvokeContext()
          Create an InvokeContext without existing pipelines.
InvokeContext(boolean isBuildingPipelineOnly)
          Create an InvokeContext
 
Method Summary
 void compose(ComponentManager manager)
          Composable Interface
 void dispose()
          Release the pipelines, if any, if they were looked up by this context.
protected  void dumpParameters()
          Dumps all sitemap parameters to log
 Map getMapByAnchor(String anchor)
          Get the result Map by anchor name
 List getMapStack()
          Get the current Map stack used to resolve expressions.
 ProcessingPipeline getProcessingPipeline()
          Get the current ProcessingPipeline
 Redirector getRedirector()
          Get the redirector to be used by nodes that need it.
 void inform(String pipelineName, Map parameters, Map objectModel)
          Informs the context about a new pipeline section
 boolean isBuildingPipelineOnly()
          Are we building a pipeline (and not executing it) ?
 boolean pipelineIsSet()
          Determines if the Pipeline been set for this context
 void popMap()
          Pop the topmost element of the current Map stack.
 void pushMap(String anchorName, Map map)
          Push a Map on top of the current Map stack.
 void recompose(ComponentManager manager)
          Recomposable interface
 void setErrorHandler(SitemapErrorHandler handler)
          Set the error handler for the pipeline.
 void setProcessingPipeline(ProcessingPipeline pipeline)
          Set the processing pipeline for sub-sitemaps
 void setRedirector(Redirector redirector)
          Set the redirector to be used by nodes that need it.
 
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, toString, wait, wait, wait
 

Field Detail

redirector

protected Redirector redirector
The redirector


processingPipelineName

protected String processingPipelineName
The name of the processing pipeline component


processingPipelineParameters

protected Map processingPipelineParameters
The parameters for the processing pipeline


processingPipelineObjectModel

protected Map processingPipelineObjectModel
The object model used to resolve processingPipelineParameters


pipelineSelector

protected ComponentSelector pipelineSelector
The Selector for the processing pipeline


processingPipeline

protected ProcessingPipeline processingPipeline
The ProcessingPipeline used


errorHandler

protected SitemapErrorHandler errorHandler
The error handler for the pipeline.

Constructor Detail

InvokeContext

public InvokeContext()
Create an InvokeContext without existing pipelines. This also means the current request is external.


InvokeContext

public InvokeContext(boolean isBuildingPipelineOnly)
Create an InvokeContext

Method Detail

pipelineIsSet

public boolean pipelineIsSet()
Determines if the Pipeline been set for this context


compose

public void compose(ComponentManager manager)
             throws ComponentException
Composable Interface

Specified by:
compose in interface Composable
Throws:
ComponentException

recompose

public void recompose(ComponentManager manager)
               throws ComponentException
Recomposable interface

Specified by:
recompose in interface Recomposable
Throws:
ComponentException

inform

public void inform(String pipelineName,
                   Map parameters,
                   Map objectModel)
Informs the context about a new pipeline section


getProcessingPipeline

public ProcessingPipeline getProcessingPipeline()
                                         throws Exception
Get the current ProcessingPipeline

Throws:
Exception

setProcessingPipeline

public void setProcessingPipeline(ProcessingPipeline pipeline)
Set the processing pipeline for sub-sitemaps


isBuildingPipelineOnly

public final boolean isBuildingPipelineOnly()
Are we building a pipeline (and not executing it) ?


getMapStack

public final List getMapStack()
Get the current Map stack used to resolve expressions.


getMapByAnchor

public final Map getMapByAnchor(String anchor)
Get the result Map by anchor name


pushMap

public final void pushMap(String anchorName,
                          Map map)
Push a Map on top of the current Map stack.


dumpParameters

protected void dumpParameters()
Dumps all sitemap parameters to log


popMap

public final void popMap()
Pop the topmost element of the current Map stack.


setRedirector

public void setRedirector(Redirector redirector)
Set the redirector to be used by nodes that need it.

Parameters:
redirector - the redirector

getRedirector

public Redirector getRedirector()
Get the redirector to be used by nodes that need it.

Returns:
the redirector

dispose

public void dispose()
Release the pipelines, if any, if they were looked up by this context.

Specified by:
dispose in interface Disposable

setErrorHandler

public void setErrorHandler(SitemapErrorHandler handler)
Set the error handler for the pipeline.



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