org.apache.cocoon.components.pipeline
Class AbstractEventPipeline

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.xml.AbstractXMLProducer
              |
              +--org.apache.cocoon.components.pipeline.AbstractEventPipeline
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.activity.Disposable, EventPipeline, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.framework.component.Recomposable, org.apache.avalon.excalibur.pool.Recyclable, XMLProducer
Direct Known Subclasses:
CachingEventPipeline, NonCachingEventPipeline

public abstract class AbstractEventPipeline
extends AbstractXMLProducer
implements EventPipeline, org.apache.avalon.framework.activity.Disposable

Version:
CVS $Id: AbstractEventPipeline.java,v 1.9 2002/04/06 17:57:54 vgritsenko Exp $
Author:
Giacomo Pati, Carsten Ziegeler, Sylvain WallezNicola Ken Barozzi, Peter Royal

Field Summary
protected  boolean configuredSAXConnector
          is a SAXConnector configured?
protected  java.util.ArrayList connectors
           
protected  Generator generator
           
protected  org.apache.avalon.framework.parameters.Parameters generatorParam
           
protected  org.apache.avalon.framework.component.ComponentSelector generatorSelector
           
protected  java.lang.String generatorSource
           
protected  org.apache.avalon.framework.component.ComponentManager manager
          the component manager set with compose()
protected  org.apache.avalon.framework.component.ComponentManager newManager
          the component manager set with compose() and recompose()
protected  java.util.ArrayList transformerParams
           
protected  java.util.ArrayList transformers
           
protected  java.util.ArrayList transformerSelectors
           
protected  java.util.ArrayList transformerSources
           
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.components.pipeline.EventPipeline
ROLE
 
Constructor Summary
AbstractEventPipeline()
           
 
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.
protected  boolean checkPipeline()
          Sanity check the non-reader pipeline.
 void compose(org.apache.avalon.framework.component.ComponentManager manager)
           
protected  void connectPipeline(Environment environment)
          Connect the pipeline.
 void dispose()
           
 Generator getGenerator()
          Get the generator used by this pipeline.
 boolean process(Environment environment)
          Process the given Environment, producing the output.
 void recompose(org.apache.avalon.framework.component.ComponentManager manager)
           
 void recycle()
          Recycle the producer by removing references
 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.
protected  void setupPipeline(Environment environment)
          Setup pipeline components.
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

generator

protected Generator generator

generatorParam

protected org.apache.avalon.framework.parameters.Parameters generatorParam

generatorSource

protected java.lang.String generatorSource

generatorSelector

protected org.apache.avalon.framework.component.ComponentSelector generatorSelector

transformers

protected java.util.ArrayList transformers

transformerParams

protected java.util.ArrayList transformerParams

transformerSources

protected java.util.ArrayList transformerSources

transformerSelectors

protected java.util.ArrayList transformerSelectors

connectors

protected java.util.ArrayList connectors

manager

protected org.apache.avalon.framework.component.ComponentManager manager
the component manager set with compose()

configuredSAXConnector

protected boolean configuredSAXConnector
is a SAXConnector configured?

newManager

protected org.apache.avalon.framework.component.ComponentManager newManager
the component manager set with compose() and recompose()
Constructor Detail

AbstractEventPipeline

public AbstractEventPipeline()
Method Detail

compose

public void compose(org.apache.avalon.framework.component.ComponentManager manager)
             throws org.apache.avalon.framework.component.ComponentException
Specified by:
compose in interface org.apache.avalon.framework.component.Composable

recompose

public void recompose(org.apache.avalon.framework.component.ComponentManager manager)
               throws org.apache.avalon.framework.component.ComponentException
Specified by:
recompose in interface org.apache.avalon.framework.component.Recomposable

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
Deprecated. The NotifyingGenerator gets the Notificable from the objectModel

Description copied from interface: EventPipeline
Same as EventPipeline.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.
Specified by:
setGenerator in interface EventPipeline
Following copied from interface: org.apache.cocoon.components.pipeline.EventPipeline
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

setGenerator

public void setGenerator(java.lang.String role,
                         java.lang.String source,
                         org.apache.avalon.framework.parameters.Parameters param)
                  throws java.lang.Exception
Description copied from interface: EventPipeline
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().
Specified by:
setGenerator in interface EventPipeline
Following copied from interface: org.apache.cocoon.components.pipeline.EventPipeline
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.

getGenerator

public Generator getGenerator()
Description copied from interface: EventPipeline
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.
Specified by:
getGenerator in interface EventPipeline
Following copied from interface: org.apache.cocoon.components.pipeline.EventPipeline
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
Description copied from interface: EventPipeline
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().
Specified by:
addTransformer in interface EventPipeline
Following copied from interface: org.apache.cocoon.components.pipeline.EventPipeline
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.

process

public boolean process(Environment environment)
                throws java.lang.Exception
Description copied from interface: EventPipeline
Process the given Environment, producing the output.
Specified by:
process in interface EventPipeline

checkPipeline

protected boolean checkPipeline()
Sanity check the non-reader pipeline.
Returns:
true if the pipeline is 'sane', false otherwise.

setupPipeline

protected void setupPipeline(Environment environment)
                      throws ProcessingException
Setup pipeline components.

connectPipeline

protected void connectPipeline(Environment environment)
                        throws ProcessingException
Connect the pipeline.

recycle

public void recycle()
Description copied from class: AbstractXMLProducer
Recycle the producer by removing references
Specified by:
recycle in interface org.apache.avalon.excalibur.pool.Recyclable
Overrides:
recycle in class AbstractXMLProducer

dispose

public void dispose()
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable


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