org.apache.cocoon.components.pipeline
Interface EventPipeline

All Superinterfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.framework.component.Recomposable, org.apache.avalon.excalibur.pool.Recyclable, XMLProducer
All Known Implementing Classes:
AbstractEventPipeline

public interface EventPipeline
extends XMLProducer, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Recomposable, org.apache.avalon.excalibur.pool.Recyclable

A pipeline that produces SAX events using a Generator and zero or more Transformers.

An EventPipeline is Recomposable since the ComponentManager used to get the generator and transformers depends on the pipeline assembly engine where they are defined (i.e. a given sitemap file).

Version:
CVS $Id: EventPipeline.java,v 1.4 2002/02/22 07:00:11 cziegeler Exp $
Author:
Giacomo Pati

Field Summary
static java.lang.String ROLE
           
 
Method Summary
 void addTransformer(java.lang.String role, java.lang.String source, org.apache.avalon.framework.parameters.Parameters param)
          Add a transformer at the end of the pipeline.
 Generator getGenerator()
          Get the generator used by this pipeline.
 boolean process(Environment environment)
          Process the given Environment, producing the output.
 void setGenerator(java.lang.String role, java.lang.String source, org.apache.avalon.framework.parameters.Parameters param)
          Set the generator that will be used as the initial step in the pipeline.
 void setGenerator(java.lang.String role, java.lang.String source, org.apache.avalon.framework.parameters.Parameters param, java.lang.Exception e)
          Same as setGenerator(String, String, Parameters) with an additional Exception parameter.
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 
Methods inherited from interface org.apache.avalon.framework.component.Recomposable
recompose
 
Methods inherited from interface org.apache.avalon.framework.component.Composable
compose
 
Methods inherited from interface org.apache.avalon.excalibur.pool.Recyclable
recycle
 

Field Detail

ROLE

public static final java.lang.String ROLE
Method Detail

process

public boolean process(Environment environment)
                throws java.lang.Exception
Process the given Environment, producing the output.

setGenerator

public void setGenerator(java.lang.String role,
                         java.lang.String source,
                         org.apache.avalon.framework.parameters.Parameters param)
                  throws java.lang.Exception
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 ComponentManager given by compose() or recompose().
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:
java.lang.Exception - if the generator couldn't be obtained.

setGenerator

public void setGenerator(java.lang.String role,
                         java.lang.String source,
                         org.apache.avalon.framework.parameters.Parameters param,
                         java.lang.Exception e)
                  throws java.lang.Exception
Same as setGenerator(String, String, Parameters) with an additional Exception parameter. This is used for setting the special {link org.apache.cocoon.sitemap.ErrorNotifier} generator used to generate input for error pages.
Parameters:
role - the generator role in the component manager.
source - the source where to produce XML from (e.g. xml file), or null if no source is given.
param - the parameters for the generator.
e - the exception to generate.
Throws:
java.lang.Exception - if the generator couldn't be obtained.
See Also:
ErrorNotifier

getGenerator

public Generator getGenerator()
Get the generator used by this pipeline. Access to the generator is needed for content aggregation since the aggregation generator is fed by the pipeline engine with the different parts.
Returns:
the generator

addTransformer

public void addTransformer(java.lang.String role,
                           java.lang.String source,
                           org.apache.avalon.framework.parameters.Parameters param)
                    throws java.lang.Exception
Add a transformer at the end of the pipeline. The transformer role is given : the actual Transformer is fetched from the latest ComponentManager given by compose() or recompose().
Parameters:
role - the transformer role in the component 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:
java.lang.Exception - if the generator couldn't be obtained.


Copyright � 1999-2002 Apache Software Foundation. All Rights Reserved.