org.apache.cocoon.components.pipeline
Class AbstractStreamPipeline

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.components.pipeline.AbstractStreamPipeline
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.framework.component.Recomposable, org.apache.avalon.excalibur.pool.Recyclable, StreamPipeline
Direct Known Subclasses:
CachingStreamPipeline, NonCachingStreamPipeline

public abstract class AbstractStreamPipeline
extends org.apache.avalon.framework.logger.AbstractLoggable
implements StreamPipeline, org.apache.avalon.framework.activity.Disposable

A ResourcePipeline either

Version:
CVS $Id: AbstractStreamPipeline.java,v 1.8 2002/02/22 07:00:11 cziegeler Exp $
Author:
Giacomo Pati, Carsten Ziegeler, Sylvain Wallez

Field Summary
protected  EventPipeline eventPipeline
           
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  Reader reader
           
protected  java.lang.String readerMimeType
           
protected  org.apache.avalon.framework.parameters.Parameters readerParam
           
protected  OutputComponentSelector readerSelector
           
protected  java.lang.String readerSource
           
protected  Serializer serializer
           
protected  java.lang.String serializerMimeType
           
protected  org.apache.avalon.framework.parameters.Parameters serializerParam
           
protected  OutputComponentSelector serializerSelector
           
protected  java.lang.String serializerSource
           
protected  java.lang.String sitemapReaderMimeType
           
protected  java.lang.String sitemapSerializerMimeType
           
 
Fields inherited from interface org.apache.cocoon.components.pipeline.StreamPipeline
ROLE
 
Constructor Summary
AbstractStreamPipeline()
           
 
Method Summary
protected  boolean checkPipeline()
          Sanity check the non-reader pipeline.
 void compose(org.apache.avalon.framework.component.ComponentManager manager)
          Pass the ComponentManager to the Composable.
protected  void connectPipeline()
          Connect the pipeline.
 void dispose()
           
 EventPipeline getEventPipeline()
          Get the EventPipeline
 boolean process(Environment environment)
          Process the given Environment producing the output
protected  boolean processReader(Environment environment)
          Process the pipeline using a reader.
 void recompose(org.apache.avalon.framework.component.ComponentManager manager)
           
 void recycle()
           
 void setEventPipeline(EventPipeline eventPipeline)
          Set the EventPipeline
 void setReader(java.lang.String role, java.lang.String source, org.apache.avalon.framework.parameters.Parameters param)
          Set the reader for this pipeline
 void setReader(java.lang.String role, java.lang.String source, org.apache.avalon.framework.parameters.Parameters param, java.lang.String mimeType)
          Set the reader for this pipeline
 void setSerializer(java.lang.String role, java.lang.String source, org.apache.avalon.framework.parameters.Parameters param)
          Set the serializer for this pipeline
 void setSerializer(java.lang.String role, java.lang.String source, org.apache.avalon.framework.parameters.Parameters param, java.lang.String mimeType)
          Set the serializer for this pipeline
protected  void setupPipeline(Environment environment)
          Setup pipeline components.
 
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
 

Field Detail

eventPipeline

protected EventPipeline eventPipeline

reader

protected Reader reader

readerParam

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

readerSource

protected java.lang.String readerSource

readerMimeType

protected java.lang.String readerMimeType

sitemapReaderMimeType

protected java.lang.String sitemapReaderMimeType

serializer

protected Serializer serializer

serializerParam

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

serializerSource

protected java.lang.String serializerSource

serializerMimeType

protected java.lang.String serializerMimeType

sitemapSerializerMimeType

protected java.lang.String sitemapSerializerMimeType

readerSelector

protected OutputComponentSelector readerSelector

serializerSelector

protected OutputComponentSelector serializerSelector

manager

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

newManager

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

AbstractStreamPipeline

public AbstractStreamPipeline()
Method Detail

compose

public void compose(org.apache.avalon.framework.component.ComponentManager manager)
             throws org.apache.avalon.framework.component.ComponentException
Pass the ComponentManager to the Composable. The Composable implementation should use the specified ComponentManager to acquire the components it needs for execution.
Specified by:
compose in interface org.apache.avalon.framework.component.Composable
Parameters:
manager - The ComponentManager which this Composable uses.
Throws:
org.apache.avalon.framework.component.ComponentException -  

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

setEventPipeline

public void setEventPipeline(EventPipeline eventPipeline)
                      throws java.lang.Exception
Description copied from interface: StreamPipeline
Set the EventPipeline
Specified by:
setEventPipeline in interface StreamPipeline

getEventPipeline

public EventPipeline getEventPipeline()
Description copied from interface: StreamPipeline
Get the EventPipeline
Specified by:
getEventPipeline in interface StreamPipeline

setReader

public void setReader(java.lang.String role,
                      java.lang.String source,
                      org.apache.avalon.framework.parameters.Parameters param)
               throws java.lang.Exception
Description copied from interface: StreamPipeline
Set the reader for this pipeline
Specified by:
setReader in interface StreamPipeline

setReader

public void setReader(java.lang.String role,
                      java.lang.String source,
                      org.apache.avalon.framework.parameters.Parameters param,
                      java.lang.String mimeType)
               throws java.lang.Exception
Description copied from interface: StreamPipeline
Set the reader for this pipeline
Specified by:
setReader in interface StreamPipeline

setSerializer

public void setSerializer(java.lang.String role,
                          java.lang.String source,
                          org.apache.avalon.framework.parameters.Parameters param)
                   throws java.lang.Exception
Description copied from interface: StreamPipeline
Set the serializer for this pipeline
Specified by:
setSerializer in interface StreamPipeline

setSerializer

public void setSerializer(java.lang.String role,
                          java.lang.String source,
                          org.apache.avalon.framework.parameters.Parameters param,
                          java.lang.String mimeType)
                   throws java.lang.Exception
Description copied from interface: StreamPipeline
Set the serializer for this pipeline
Specified by:
setSerializer in interface StreamPipeline

process

public boolean process(Environment environment)
                throws ProcessingException
Description copied from interface: StreamPipeline
Process the given Environment producing the output
Specified by:
process in interface StreamPipeline

processReader

protected boolean processReader(Environment environment)
                         throws ProcessingException
Process the pipeline using a reader.
Throws:
ProcessingException - if

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. The mimeType is set for the serializer. The output stream must be set by the subclass.

connectPipeline

protected void connectPipeline()
                        throws ProcessingException
Connect the pipeline.

dispose

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

recycle

public void recycle()
Specified by:
recycle in interface org.apache.avalon.excalibur.pool.Recyclable


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