org.apache.cocoon.components.treeprocessor
Class InvokeContext

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.components.treeprocessor.InvokeContext
All Implemented Interfaces:
Disposable, Serviceable

public class InvokeContext
extends org.apache.cocoon.util.AbstractLogEnabled
implements Serviceable, Disposable

The invocation context of ProcessingNodes.

This class serves two purposes:

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

Field Summary
protected  org.apache.cocoon.sitemap.SitemapErrorHandler errorHandler
          The error handler for the pipeline.
protected  org.apache.cocoon.Processor.InternalPipelineDescription internalPipelineDescription
          The internal pipeline description
protected  org.apache.cocoon.Processor lastProcessor
          The last processor
protected  org.apache.cocoon.components.pipeline.ProcessingPipeline processingPipeline
          The ProcessingPipeline used
protected  Parameters processingPipelineParameters
          The parameters for the processing pipeline
protected  String processingPipelineType
          The name of the processing pipeline component
protected  org.apache.cocoon.environment.Redirector redirector
          The redirector
 
Constructor Summary
InvokeContext()
          Create an InvokeContext without existing pipelines.
InvokeContext(boolean isBuildingPipelineOnly)
          Create an InvokeContext
InvokeContext(InvokeContext context, ServiceManager manager)
          Create an InvokeContext based on existing context.
 
Method Summary
 void dispose()
          Release the pipelines, if any, if they were looked up by this context.
protected  void dumpParameters()
          Dumps all sitemap parameters to log
 org.apache.cocoon.Processor.InternalPipelineDescription getInternalPipelineDescription(org.apache.cocoon.environment.Environment env)
          Get the pipeline description
 Map getMapByAnchor(String anchor)
          Get the result Map by anchor name
 List getMapStack()
          Get the current Map stack used to resolve expressions.
 Parameters getPipelineParameters()
           
 String getPipelineType()
           
 org.apache.cocoon.components.pipeline.ProcessingPipeline getProcessingPipeline()
          Get the current ProcessingPipeline
 org.apache.cocoon.environment.Redirector getRedirector()
          Get the redirector to be used by nodes that need it.
 boolean hasPipeline()
          Returns true if pipeline has been set for this context
 void inform(String pipelineType, Parameters parameters)
          Informs the context about a new pipeline section
 boolean isBuildingPipelineOnly()
          Are we building a pipeline (and not executing it) ?
 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 service(ServiceManager manager)
          Serviceable interface.
 void setErrorHandler(org.apache.cocoon.sitemap.SitemapErrorHandler handler)
          Set the error handler for the pipeline.
 void setInternalPipelineDescription(org.apache.cocoon.Processor.InternalPipelineDescription desc)
          Set the processing pipeline for sub-sitemaps
 void setLastProcessor(org.apache.cocoon.Processor p)
          Set the last processor
 void setRedirector(org.apache.cocoon.environment.Redirector redirector)
          Set the redirector to be used by nodes that need it.
 
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

redirector

protected org.apache.cocoon.environment.Redirector redirector
The redirector


lastProcessor

protected org.apache.cocoon.Processor lastProcessor
The last processor


errorHandler

protected org.apache.cocoon.sitemap.SitemapErrorHandler errorHandler
The error handler for the pipeline.


processingPipelineType

protected String processingPipelineType
The name of the processing pipeline component


processingPipelineParameters

protected Parameters processingPipelineParameters
The parameters for the processing pipeline


processingPipeline

protected org.apache.cocoon.components.pipeline.ProcessingPipeline processingPipeline
The ProcessingPipeline used


internalPipelineDescription

protected org.apache.cocoon.Processor.InternalPipelineDescription internalPipelineDescription
The internal pipeline description

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


InvokeContext

public InvokeContext(InvokeContext context,
                     ServiceManager manager)
              throws ServiceException
Create an InvokeContext based on existing context.

Method Detail

service

public void service(ServiceManager manager)
             throws ServiceException
Serviceable interface. InvokeContext receives manager from ConcreteTreeProcessor.

Specified by:
service in interface Serviceable
Throws:
ServiceException

isBuildingPipelineOnly

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


setRedirector

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

Parameters:
redirector - the redirector

getRedirector

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

Returns:
the redirector

setLastProcessor

public void setLastProcessor(org.apache.cocoon.Processor p)
Set the last processor


inform

public void inform(String pipelineType,
                   Parameters parameters)
Informs the context about a new pipeline section


getPipelineType

public String getPipelineType()

getPipelineParameters

public Parameters getPipelineParameters()

setErrorHandler

public void setErrorHandler(org.apache.cocoon.sitemap.SitemapErrorHandler handler)
Set the error handler for the pipeline.


hasPipeline

public boolean hasPipeline()
Returns true if pipeline has been set for this context


getProcessingPipeline

public org.apache.cocoon.components.pipeline.ProcessingPipeline getProcessingPipeline()
                                                                               throws Exception
Get the current ProcessingPipeline

Throws:
Exception

setInternalPipelineDescription

public void setInternalPipelineDescription(org.apache.cocoon.Processor.InternalPipelineDescription desc)
Set the processing pipeline for sub-sitemaps


getInternalPipelineDescription

public org.apache.cocoon.Processor.InternalPipelineDescription getInternalPipelineDescription(org.apache.cocoon.environment.Environment env)
Get the pipeline description


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.


popMap

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


dumpParameters

protected void dumpParameters()
Dumps all sitemap parameters to log


dispose

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

Specified by:
dispose in interface Disposable


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