org.apache.cocoon.components.pipeline
Interface ProcessingPipeline


public interface ProcessingPipeline

A ProcessingPipeline produces the response for a given request. It is assembled according to the commands in the sitemap and can either

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

Field Summary
static String ROLE
           
 
Method Summary
 void addTransformer(String role, String source, Parameters param, Parameters hintParam)
          Add a transformer at the end of the pipeline.
 Generator getGenerator()
          Get the generator - used for content aggregation
 String getKeyForEventPipeline()
          Return the key for the event pipeline If the "event pipeline" (= the complete pipeline without the serializer) is cacheable and valid, return a key.
 SourceValidity getValidityForEventPipeline()
          Return valid validity objects for the event pipeline If the "event pipeline" (= the complete pipeline without the serializer) is cacheable and valid, return all validity objects.
 void informBranchPoint()
          Informs pipeline we have come across a branch point
 void prepareInternal(Environment environment)
          Prepare an internal processing
 boolean process(Environment environment)
          Process the given Environment, producing the output.
 boolean process(Environment environment, XMLConsumer consumer)
          Process the given Environment, but do not use the serializer.
 void setErrorHandler(SitemapErrorHandler errorHandler)
          Sets error handler for this pipeline.
 void setGenerator(String role, String source, Parameters param, Parameters hintParam)
          Set the generator that will be used as the initial step in the pipeline.
 void setProcessorManager(ServiceManager manager)
          Set the ServiceManager where pipeline components have to be searched for.
 void setReader(String role, String source, Parameters param, String mimeType)
          Set the reader for this pipeline
 void setSerializer(String role, String source, Parameters param, Parameters hintParam, String mimeType)
          Set the serializer for this pipeline
 void setup(Parameters params)
          Setup this component.
 

Field Detail

ROLE

public static final String ROLE
Method Detail

setup

public void setup(Parameters params)
Setup this component.


setGenerator

public void setGenerator(String role,
                         String source,
                         Parameters param,
                         Parameters hintParam)
                  throws ProcessingException
Set the generator that will be used as the initial step in the pipeline. The generator role is given : the actual Generator is fetched from the latest ServiceManager.

Parameters:
role - the generator role in the component manager.
source - the source where to produce XML from, or null if no source is given.
param - the parameters for the generator.
Throws:
ProcessingException - if the generator couldn't be obtained.

getGenerator

public Generator getGenerator()
Get the generator - used for content aggregation


informBranchPoint

public void informBranchPoint()
Informs pipeline we have come across a branch point


setProcessorManager

public void setProcessorManager(ServiceManager manager)
Set the ServiceManager where pipeline components have to be searched for.

Parameters:
manager - the processor's service manager.

addTransformer

public void addTransformer(String role,
                           String source,
                           Parameters param,
                           Parameters hintParam)
                    throws ProcessingException
Add a transformer at the end of the pipeline. The transformer role is given : the actual Transformer is fetched from the latest ServiceManager.

Parameters:
role - the transformer role in the service manager.
source - the source used to setup the transformer (e.g. XSL file), or null if no source is given.
param - the parameters for the transfomer.
Throws:
ProcessingException - if the generator couldn't be obtained.

setSerializer

public void setSerializer(String role,
                          String source,
                          Parameters param,
                          Parameters hintParam,
                          String mimeType)
                   throws ProcessingException
Set the serializer for this pipeline

Parameters:
mimeType - Can be null
Throws:
ProcessingException

setReader

public void setReader(String role,
                      String source,
                      Parameters param,
                      String mimeType)
               throws ProcessingException
Set the reader for this pipeline

Parameters:
mimeType - Can be null
Throws:
ProcessingException

setErrorHandler

public void setErrorHandler(SitemapErrorHandler errorHandler)
                     throws ProcessingException
Sets error handler for this pipeline. Used for handling errors in the internal pipelines.

Throws:
ProcessingException

process

public boolean process(Environment environment)
                throws ProcessingException
Process the given Environment, producing the output.

Throws:
ProcessingException

prepareInternal

public void prepareInternal(Environment environment)
                     throws ProcessingException
Prepare an internal processing

Parameters:
environment - The current environment.
Throws:
ProcessingException

process

public boolean process(Environment environment,
                       XMLConsumer consumer)
                throws ProcessingException
Process the given Environment, but do not use the serializer. Instead the sax events are streamed to the XMLConsumer. Make sure to call prepareInternal(Environment) beforehand.

Throws:
ProcessingException

getValidityForEventPipeline

public SourceValidity getValidityForEventPipeline()
Return valid validity objects for the event pipeline If the "event pipeline" (= the complete pipeline without the serializer) is cacheable and valid, return all validity objects. Otherwise return null


getKeyForEventPipeline

public String getKeyForEventPipeline()
Return the key for the event pipeline If the "event pipeline" (= the complete pipeline without the serializer) is cacheable and valid, return a key. Otherwise return null



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