cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/sitemap sitemap.roles
Date Mon, 10 Dec 2001 12:56:23 GMT
sylvain     01/12/10 04:56:23

  Modified:    .        changes.xml
               src/org/apache/cocoon cocoon.roles
               src/org/apache/cocoon/components/language/markup/sitemap/java
                        sitemap.xsl
               src/org/apache/cocoon/components/pipeline
                        AbstractEventPipeline.java
                        AbstractStreamPipeline.java
                        CachingEventPipeline.java
                        CachingStreamPipeline.java EventPipeline.java
                        StreamPipeline.java
               src/org/apache/cocoon/sitemap sitemap.roles
  Log:
  The cache works again as expected.
  
  Also made StreamPipeline and EventPipeline Recomposable instead of just Composable (sitemap.xsl
changes the component manager initially set).
  
  Revision  Changes    Path
  1.55      +5 -1      xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- changes.xml	2001/12/09 17:08:17	1.54
  +++ changes.xml	2001/12/10 12:56:22	1.55
  @@ -4,7 +4,7 @@
   
   <!--
     History of Cocoon changes
  -  $Id: changes.xml,v 1.54 2001/12/09 17:08:17 gianugo Exp $
  +  $Id: changes.xml,v 1.55 2001/12/10 12:56:22 sylvain Exp $
   -->
   
   <changes title="History of Changes">
  @@ -28,6 +28,10 @@
    </devs>
   
    <release version="2.1-dev" date="@date@">
  +  <action dev="SW" type="fix">
  +    Made the cach work again by updating cocoon.roles, sitemap.roles and making EventPipeline
  +    and StreamPipeline implement Recomposable instead of just Composable.
  +  </action>
     <action dev="GR" type="add">
       Added the XML:DB pseudo protocol
     </action>
  
  
  
  1.32      +0 -29     xml-cocoon2/src/org/apache/cocoon/cocoon.roles
  
  Index: cocoon.roles
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/cocoon.roles,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- cocoon.roles	2001/12/09 21:36:42	1.31
  +++ cocoon.roles	2001/12/10 12:56:22	1.32
  @@ -133,7 +133,6 @@
          shorthand="xscript"
          default-class="org.apache.cocoon.components.xscript.XScriptManagerImpl"/>
   
  - <!-- sitemap roles -->
    <role name="org.apache.cocoon.components.pipeline.StreamPipeline"
          shorthand="stream-pipeline"
          default-class="org.apache.cocoon.components.pipeline.NonCachingStreamPipeline"/>
  @@ -144,34 +143,6 @@
   
    <role name="org.apache.cocoon.components.saxconnector.SAXConnector"
          shorthand="sax-connector"/>
  -
  - <role name="org.apache.cocoon.acting.ActionSelector"
  -       shorthand="action"
  -       default-class="org.apache.cocoon.sitemap.SitemapComponentSelector"/>
  -
  - <role name="org.apache.cocoon.selection.SelectorSelector"
  -       shorthand="selector"
  -       default-class="org.apache.cocoon.sitemap.SitemapComponentSelector"/>
  -
  - <role name="org.apache.cocoon.matching.MatcherSelector"
  -       shorthand="matcher"
  -       default-class="org.apache.cocoon.sitemap.SitemapComponentSelector"/>
  -
  - <role name="org.apache.cocoon.generation.GeneratorSelector"
  -       shorthand="generator"
  -       default-class="org.apache.cocoon.sitemap.SitemapComponentSelector"/>
  -
  - <role name="org.apache.cocoon.transformation.TransformerSelector"
  -       shorthand="transformer"
  -       default-class="org.apache.cocoon.sitemap.SitemapComponentSelector"/>
  -
  - <role name="org.apache.cocoon.serialization.SerializerSelector"
  -       shorthand="serializer"
  -       default-class="org.apache.cocoon.sitemap.SitemapComponentSelector"/>
  -
  - <role name="org.apache.cocoon.reading.ReaderSelector"
  -       shorthand="reader"
  -       default-class="org.apache.cocoon.sitemap.SitemapComponentSelector"/>
   
    <role name="org.apache.avalon.excalibur.monitor.Monitor"
          shorthand="monitor"
  
  
  
  1.54      +16 -16    xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
  
  Index: sitemap.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- sitemap.xsl	2001/12/10 09:05:54	1.53
  +++ sitemap.xsl	2001/12/10 12:56:22	1.54
  @@ -126,7 +126,7 @@
        *
        * @author &lt;a href="mailto:giacomo@apache.org"&gt;Giacomo Pati&lt;/a&gt;
        * @author &lt;a href="mailto:bloritsch@apache.org"&gt;Berin Loritsch&lt;/a&gt;
  -     * @version CVS $Id: sitemap.xsl,v 1.53 2001/12/10 09:05:54 haul Exp $
  +     * @version CVS $Id: sitemap.xsl,v 1.54 2001/12/10 12:56:22 sylvain Exp $
        */
       public class <xsl:value-of select="@file-name"/> extends AbstractSitemap {
         static final String LOCATION = "<xsl:value-of select="translate(@file-path, '/',
'.')"/>.<xsl:value-of select="@file-name"/>";
  @@ -625,8 +625,8 @@
                                       EventPipeline eventPipeline, boolean internalRequest)
         throws Exception {
           // set the correct component manager
  -        pipeline.compose(this.manager);
  -        eventPipeline.compose(this.manager);
  +        pipeline.recompose(this.manager);
  +        eventPipeline.recompose(this.manager);
   
           /* the &lt;code&gt;List&lt;/code&gt; objects to hold the replacement
values
              delivered from matchers and selectors to replace occurences of
  @@ -1395,21 +1395,21 @@
       <xsl:choose>
   
         <xsl:when test="map:parameter">
  -        map = new HashMap(<xsl:value-of select="count(map:parameter)"/>);
  +      map = new HashMap(<xsl:value-of select="count(map:parameter)"/>);
   
  -        <xsl:for-each select="map:parameter">
  -          <xsl:variable name="name">
  -            <xsl:call-template name="get-parameter">
  -              <xsl:with-param name="parname">name</xsl:with-param>
  -            </xsl:call-template>
  -          </xsl:variable>
  -          <xsl:variable name="value">
  -            <xsl:call-template name="get-parameter">
  -              <xsl:with-param name="parname">value</xsl:with-param>
  -            </xsl:call-template>
  -          </xsl:variable>
  -          map.put("<xsl:value-of select="$name"/>", substitute(listOfMaps, "<xsl:value-of
select="$value"/>"));
  -        </xsl:for-each>
  +      <xsl:for-each select="map:parameter">
  +        <xsl:variable name="name">
  +          <xsl:call-template name="get-parameter">
  +            <xsl:with-param name="parname">name</xsl:with-param>
  +          </xsl:call-template>
  +        </xsl:variable>
  +        <xsl:variable name="value">
  +          <xsl:call-template name="get-parameter">
  +            <xsl:with-param name="parname">value</xsl:with-param>
  +          </xsl:call-template>
  +        </xsl:variable>
  +        map.put("<xsl:value-of select="$name"/>", substitute(listOfMaps, "<xsl:value-of
select="$value"/>"));
  +      </xsl:for-each>
   
         </xsl:when>
   
  
  
  
  1.18      +56 -43    xml-cocoon2/src/org/apache/cocoon/components/pipeline/AbstractEventPipeline.java
  
  Index: AbstractEventPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/pipeline/AbstractEventPipeline.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- AbstractEventPipeline.java	2001/11/28 11:18:45	1.17
  +++ AbstractEventPipeline.java	2001/12/10 12:56:22	1.18
  @@ -31,34 +31,42 @@
   /**
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:cziegeler@Carsten Ziegeler">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.17 $ $Date: 2001/11/28 11:18:45 $
  + * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  + * @version CVS $Revision: 1.18 $ $Date: 2001/12/10 12:56:22 $
    */
   public abstract class AbstractEventPipeline
  -extends AbstractXMLProducer
  -implements EventPipeline, Disposable {
  +  extends AbstractXMLProducer
  +  implements EventPipeline, Disposable {
   
  +    // Generator stuff
       protected Generator generator;
       protected Parameters generatorParam;
       protected String generatorSource;
       protected ComponentSelector generatorSelector;
  -    protected ComponentSelector transformerSelector;
  +    
  +    // Transformer stuff
       protected ArrayList transformers = new ArrayList();
       protected ArrayList transformerParams = new ArrayList();
       protected ArrayList transformerSources = new ArrayList();
  +    protected ArrayList transformerSelectors = new ArrayList();
  +    
       protected ArrayList connectors = new ArrayList();
   
  -    /** the component manager */
  +    /** the component manager set with compose() */
       protected ComponentManager manager;
  +    
  +    /** the component manager set with compose() and recompose() */
  +    protected ComponentManager newManager;
   
  -    /** is a SAXConnector configured? */
  -    protected boolean configuredSAXConnector;
  -
       public void compose (ComponentManager manager)
       throws ComponentException {
           this.manager = manager;
  -        generatorSelector = (ComponentSelector) this.manager.lookup(Generator.ROLE + "Selector");
  -        transformerSelector = (ComponentSelector) this.manager.lookup(Transformer.ROLE
+ "Selector");
  -        this.configuredSAXConnector = this.manager.hasComponent(SAXConnector.ROLE);
  +        this.newManager = manager;
  +    }
  +
  +    public void recompose (ComponentManager manager)
  +    throws ComponentException {
  +        this.newManager = manager;
       }
   
       public void setGenerator (String role, String source, Parameters param, Exception e)
  @@ -77,7 +85,8 @@
           if (this.generator != null) {
               throw new ProcessingException ("Generator already set. You can only select
one Generator (" + role + ")");
           }
  -        this.generator = (Generator) generatorSelector.select(role);
  +        this.generatorSelector = (ComponentSelector) this.newManager.lookup(Generator.ROLE
+ "Selector");
  +        this.generator = (Generator) this.generatorSelector.select(role);
           this.generatorSource = source;
           this.generatorParam = param;
       }
  @@ -88,9 +97,11 @@
   
       public void addTransformer (String role, String source, Parameters param)
       throws Exception {
  -        this.transformers.add ((Transformer)transformerSelector.select(role));
  -        this.transformerSources.add (source);
  -        this.transformerParams.add (param);
  +        ComponentSelector selector = (ComponentSelector) this.newManager.lookup(Transformer.ROLE
+ "Selector");
  +        this.transformerSelectors.add(selector);
  +        this.transformers.add((Transformer)selector.select(role));
  +        this.transformerSources.add(source);
  +        this.transformerParams.add(param);
       }
   
       public boolean process(Environment environment) throws Exception {
  @@ -177,16 +188,19 @@
       /** Connect the pipeline.
        */
       protected void connectPipeline(Environment environment) throws ProcessingException
{
  -        XMLProducer prev = (XMLProducer) this.generator;
  +        XMLProducer prev = (XMLProducer)this.generator;
           XMLConsumer next;
  +        
  +        // Looked up in manager and not newManager (it's not a sitemap component)
  +        boolean configuredSAXConnector = this.manager.hasComponent(SAXConnector.ROLE);
   
           try {
               Iterator itt = this.transformers.iterator();
               while ( itt.hasNext() ) {
  -                if (this.configuredSAXConnector == true) {
  +                if (configuredSAXConnector) {
                       // connect SAXConnector
                       SAXConnector connect = (SAXConnector) this.manager.lookup(SAXConnector.ROLE);
  -                    connect.setup(environment,environment.getObjectModel(),null,null);
  +                    connect.setup(environment,environment.getObjectModel(), null, null);
                       this.connectors.add(connect);
                       next = connect;
                       prev.setConsumer(next);
  @@ -199,10 +213,10 @@
                   prev = trans;
               }
   
  -            if (this.configuredSAXConnector == true) {
  +            if (configuredSAXConnector) {
                   // insert SAXConnector
                   SAXConnector connect = (SAXConnector) this.manager.lookup(SAXConnector.ROLE);
  -                connect.setup(environment,environment.getObjectModel(),null,null);
  +                connect.setup(environment,environment.getObjectModel(), null, null);
                   this.connectors.add(connect);
                   next = connect;
                   prev.setConsumer(next);
  @@ -229,32 +243,22 @@
   
       }
   
  -    public void dispose() {
  -        if(generatorSelector != null){
  -            manager.release(generatorSelector);
  -            generatorSelector = null;
  -        }
  -        if(transformerSelector != null){
  -            manager.release(transformerSelector);
  -            transformerSelector = null;
  -        }
  -    }
  -
       public void recycle() {
           super.recycle();
   
           try {
               // Release generator.
  -            if ( generatorSelector != null && this.generator != null ) {
  +            if ( generatorSelector != null ) {
                   generatorSelector.release(this.generator);
               }
   
               // Release transformers
  -            if ( transformerSelector != null ) {
  -                Iterator itt = this.transformers.iterator();
  -                while ( itt.hasNext() ) {
  -                    transformerSelector.release((Component)itt.next());
  -                }
  +            int size = this.transformerSelectors.size();
  +            for (int i = 0; i < size; i++)
  +            {
  +                ((ComponentSelector)this.transformerSelectors.get(i)).release(
  +                    (Component)this.transformers.get(i)
  +                );
               }
   
               // Release connectors
  @@ -267,12 +271,21 @@
                   "Failed to release components from event pipeline.",
                   e
               );
  +        } finally {
  +    
  +            // FIXME : in theory selectors should be released on their respective managers
  +            // but this causes no harm since they're ThreadSafe
  +            this.generatorSelector = null;
  +            this.generator = null;
  +            this.transformerSelectors.clear();
  +            this.transformers.clear();
  +            this.transformerParams.clear();
  +            this.transformerSources.clear();
  +            this.connectors.clear();
           }
  -
  -        this.generator = null;
  -        this.transformers.clear();
  -        this.transformerParams.clear();
  -        this.transformerSources.clear();
  -        this.connectors.clear();
  +    }
  +    
  +    public void dispose() {
  +        // Nothing here
       }
   }
  
  
  
  1.12      +24 -17    xml-cocoon2/src/org/apache/cocoon/components/pipeline/AbstractStreamPipeline.java
  
  Index: AbstractStreamPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/pipeline/AbstractStreamPipeline.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AbstractStreamPipeline.java	2001/10/11 07:28:18	1.11
  +++ AbstractStreamPipeline.java	2001/12/10 12:56:22	1.12
  @@ -30,7 +30,8 @@
    * </UL>
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.11 $ $Date: 2001/10/11 07:28:18 $
  + * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  + * @version CVS $Revision: 1.12 $ $Date: 2001/12/10 12:56:22 $
    */
   public abstract class AbstractStreamPipeline extends AbstractLoggable implements StreamPipeline,
Disposable {
       protected EventPipeline eventPipeline;
  @@ -47,8 +48,11 @@
       protected SitemapComponentSelector readerSelector;
       protected SitemapComponentSelector serializerSelector;
   
  -    /** the component manager */
  +    /** the component manager set with compose() */
       protected ComponentManager manager;
  +    
  +    /** the component manager set with compose() and recompose() */
  +    protected ComponentManager newManager;
   
       /**
        * Pass the <code>ComponentManager</code> to the <code>Composable</code>.
  @@ -61,10 +65,14 @@
        * @throws ComponentException  */
       public void compose (ComponentManager manager) throws ComponentException {
           this.manager = manager;
  -        readerSelector = (SitemapComponentSelector) this.manager.lookup(Reader.ROLE + "Selector");
  -        serializerSelector = (SitemapComponentSelector) this.manager.lookup(Serializer.ROLE
+ "Selector");
  +        this.newManager = manager;
       }
   
  +    public void recompose (ComponentManager manager)
  +    throws ComponentException {
  +        this.newManager = manager;
  +    }
  +
       public void setEventPipeline (EventPipeline eventPipeline) throws Exception {
           if (this.eventPipeline != null) {
               throw new ProcessingException ("EventPipeline already set. You can only select
one EventPipeline ");
  @@ -86,6 +94,7 @@
           if (this.reader != null) {
               throw new ProcessingException ("Reader already set. You can only select one
Reader (" + role + ")");
           }
  +        this.readerSelector = (SitemapComponentSelector) this.newManager.lookup(Reader.ROLE
+ "Selector");
           this.reader = (Reader)readerSelector.select(role);
           this.readerSource = source;
           this.readerParam = param;
  @@ -103,6 +112,7 @@
           if (this.serializer != null) {
               throw new ProcessingException ("Serializer already set. You can only select
one Serializer (" + role + ")");
           }
  +        this.serializerSelector = (SitemapComponentSelector) this.newManager.lookup(Serializer.ROLE
+ "Selector");
           this.serializer = (Serializer)serializerSelector.select(role);
           this.serializerSource = source;
           this.serializerParam = param;
  @@ -241,41 +251,38 @@
       }
   
       public void dispose() {
  -        if(readerSelector != null)
  -            manager.release(readerSelector);
  -        if(serializerSelector != null)
  -            manager.release(serializerSelector);
  +        // Nothing here
       }
   
       public void recycle() {
           try {
               // release reader.
               if ( this.readerSelector != null) {
  -                if ( this.reader != null ) {
  -                    readerSelector.release(this.reader);
  -                }
  +                readerSelector.release(this.reader);
               }
  -            this.reader = null;
   
               // release eventPipeline
               this.eventPipeline = null;
   
               // release serializer
               if ( this.serializerSelector != null ) {
  -                if ( this.serializer != null ) {
  -                    serializerSelector.release(this.serializer);
  -                }
  +                serializerSelector.release(this.serializer);
               }
  -            this.serializer = null;
  +            
           } catch ( Exception e ) {
               getLogger().warn(
                   "Failed to release components from AbstractStreamPipeline.",
                   e
               );
           } finally {
  +            // FIXME : in theory selectors should be released on their respective managers
  +            // but this causes no harm since they're ThreadSafe
  +            this.readerSelector = null;
               this.reader = null;
  -            this.eventPipeline = null;
  +            this.serializerSelector = null;
               this.serializer = null;
  +            
  +            this.eventPipeline = null;
           }
       }
   }
  
  
  
  1.20      +6 -5      xml-cocoon2/src/org/apache/cocoon/components/pipeline/CachingEventPipeline.java
  
  Index: CachingEventPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/pipeline/CachingEventPipeline.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- CachingEventPipeline.java	2001/10/11 07:28:18	1.19
  +++ CachingEventPipeline.java	2001/12/10 12:56:22	1.20
  @@ -41,7 +41,7 @@
    * does not cache! (If it would cache, the response would be cached twice!)
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.19 $ $Date: 2001/10/11 07:28:18 $
  + * @version CVS $Revision: 1.20 $ $Date: 2001/12/10 12:56:22 $
    */
   public class CachingEventPipeline
   extends AbstractEventPipeline
  @@ -304,12 +304,14 @@
           XMLProducer prev = this.producer;
           XMLConsumer next;
   
  +        boolean configuredSAXConnector = this.manager.hasComponent(SAXConnector.ROLE);
  +
           try {
               int cacheableTransformerCount = this.firstNotCacheableTransformerIndex;
   
               Iterator itt = usedTransformers.iterator();
               while ( itt.hasNext() ) {
  -                if (this.configuredSAXConnector == true) {
  +                if (configuredSAXConnector) {
                       // connect SAXConnector
                       SAXConnector connect = (SAXConnector) this.manager.lookup(SAXConnector.ROLE);
                       connect.setup(environment,environment.getObjectModel(),null,null);
  @@ -333,7 +335,7 @@
                   prev = (XMLProducer) next;
               }
   
  -            if (this.configuredSAXConnector == true) {
  +            if (configuredSAXConnector) {
                   // insert SAXConnector
                   SAXConnector connect = (SAXConnector) this.manager.lookup(SAXConnector.ROLE);
                   connect.setup(environment,environment.getObjectModel(),null,null);
  @@ -386,8 +388,7 @@
       }
   
       public void dispose() {
  -        if(this.eventCache != null)
  -            this.manager.release((Component)this.eventCache);
  +        this.manager.release((Component)this.eventCache);
           super.dispose();
       }
   }
  
  
  
  1.14      +2 -3      xml-cocoon2/src/org/apache/cocoon/components/pipeline/CachingStreamPipeline.java
  
  Index: CachingStreamPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/pipeline/CachingStreamPipeline.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CachingStreamPipeline.java	2001/10/11 07:28:18	1.13
  +++ CachingStreamPipeline.java	2001/12/10 12:56:22	1.14
  @@ -41,7 +41,7 @@
    *  </ul>
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.13 $ $Date: 2001/10/11 07:28:18 $
  + * @version CVS $Revision: 1.14 $ $Date: 2001/12/10 12:56:22 $
    */
   public class CachingStreamPipeline extends AbstractStreamPipeline {
   
  @@ -61,8 +61,7 @@
       }
   
       public void dispose() {
  -        if (this.streamCache != null)
  -            this.manager.release((Component)this.streamCache);
  +        this.manager.release(this.streamCache);
           super.dispose();
       }
   
  
  
  
  1.10      +64 -8     xml-cocoon2/src/org/apache/cocoon/components/pipeline/EventPipeline.java
  
  Index: EventPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/pipeline/EventPipeline.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- EventPipeline.java	2001/10/11 07:28:18	1.9
  +++ EventPipeline.java	2001/12/10 12:56:22	1.10
  @@ -9,27 +9,83 @@
   
   import org.apache.avalon.excalibur.pool.Recyclable;
   import org.apache.avalon.framework.component.Component;
  -import org.apache.avalon.framework.component.Composable;
  +import org.apache.avalon.framework.component.Recomposable;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.generation.Generator;
  +import org.apache.cocoon.xml.XMLProducer;
   
   /**
  + * A pipeline that produces SAX events using a <code>Generator</code> and
  + * zero or more <code>Transformer</code>s.
  + * <p>
  + * An <code>EventPipeline</code> is <code>Recomposable</code> since
the
  + * <code>ComponentManager</code> used to get the generator and transformers
  + * depends on the pipeline assembly engine where they are defined (i.e. a given
  + * sitemap file).
  + * 
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.9 $ $Date: 2001/10/11 07:28:18 $
  + * @version CVS $Revision: 1.10 $ $Date: 2001/12/10 12:56:22 $
    */
  -public interface EventPipeline extends Component, Composable, Recyclable {
  +public interface EventPipeline extends XMLProducer, Component, Recomposable, Recyclable
{
   
       String ROLE = "org.apache.cocoon.components.pipeline.EventPipeline";
   
       /**
  -     * Process the given <code>Environment</code> producing the output
  +     * Process the given <code>Environment</code>, producing the output.
        */
  -    boolean process(Environment environment)
  -    throws Exception;
  -
  -    void setGenerator (String role, String source, Parameters param, Exception e) throws
Exception;
  +    boolean process(Environment environment) throws Exception;
  +    
  +    /**
  +     * Set the generator that will be used as the initial step in the pipeline.
  +     * The generator role is given : the actual <code>Generator</code> is fetched
  +     * from the latest <code>ComponentManager</code> given by <code>compose()</code>
  +     * or <code>recompose()</code>.
  +     *
  +     * @param role the generator role in the component manager.
  +     * @param source the source where to produce XML from, or <code>null</code>
if no
  +     *        source is given.
  +     * @param param the parameters for the generator.
  +     * @throws Exception if the generator couldn't be obtained.
  +     */
       void setGenerator (String role, String source, Parameters param) throws Exception;
  +    
  +    /**
  +     * Same as {@link #setGenerator(String, String, Parameters)} with an additional
  +     * <code>Exception</code> parameter. This is used for setting the special
  +     * {link org.apache.cocoon.sitemap.ErrorNotifier} generator used to generate
  +     * input for error pages.
  +     *
  +     * @param role the generator role in the component manager.
  +     * @param source the source where to produce XML from (e.g. xml file), or
  +     *        <code>null</code> if no source is given.
  +     * @param param the parameters for the generator.
  +     * @param e the exception to generate.
  +     * @throws Exception if the generator couldn't be obtained.
  +     * @see org.apache.cocoon.sitemap.ErrorNotifier
  +     */
  +    void setGenerator (String role, String source, Parameters param, Exception e) throws
Exception;
  +    
  +    /**
  +     * 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.
  +     *
  +     * @return the generator
  +     */
       Generator getGenerator ();
  +    
  +    /**
  +     * Add a transformer at the end of the pipeline.
  +     * The transformer role is given : the actual <code>Transformer</code>
is fetched
  +     * from the latest <code>ComponentManager</code> given by <code>compose()</code>
  +     * or <code>recompose()</code>.
  +     *
  +     * @param role the transformer role in the component manager.
  +     * @param source the source used to setup the transformer (e.g. XSL file), or
  +     *        <code>null</code> if no source is given.
  +     * @param param the parameters for the transfomer.
  +     * @throws Exception if the generator couldn't be obtained.
  +     */
       void addTransformer (String role, String source, Parameters param) throws Exception;
   }
  
  
  
  1.9       +14 -8     xml-cocoon2/src/org/apache/cocoon/components/pipeline/StreamPipeline.java
  
  Index: StreamPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/pipeline/StreamPipeline.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- StreamPipeline.java	2001/10/11 07:28:18	1.8
  +++ StreamPipeline.java	2001/12/10 12:56:22	1.9
  @@ -9,20 +9,26 @@
   
   import org.apache.avalon.excalibur.pool.Recyclable;
   import org.apache.avalon.framework.component.Component;
  -import org.apache.avalon.framework.component.Composable;
  +import org.apache.avalon.framework.component.Recomposable;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.cocoon.environment.Environment;
   
  -/** A <CODE>StreamPipeline</CODE> either
  - * <UL>
  - *  <LI>collects a <CODE>Reader</CODE> and let it produce a character
stream</LI>
  - *  <LI>or connects a <CODE>EventPipeline</CODE> with a
  - *  <CODE>Serializer</CODE> and let them produce the character stream
  +/** A <code>StreamPipeline</code> either
  + * <ul>
  + *  <li>collects a <code>Reader</code> and let it produce a character
stream</li>
  + *  <li>or connects an <code>EventPipeline</code> with a
  + *  <code>Serializer</code> and let them produce the byte stream</li>
    * </UL>
  + * <p>
  + * A <code>StreamPipeline</code> is <code>Recomposable</code> since
the
  + * <code>ComponentManager</code> used to get the reader or serializer
  + * depends on the pipeline assembly engine where they are defined (i.e.
  + * a given sitemap file).
  + *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.8 $ $Date: 2001/10/11 07:28:18 $
  + * @version CVS $Revision: 1.9 $ $Date: 2001/12/10 12:56:22 $
    */
  -public interface StreamPipeline extends Component, Composable, Recyclable {
  +public interface StreamPipeline extends Component, Recomposable, Recyclable {
   
       String ROLE = "org.apache.cocoon.components.pipeline.StreamPipeline";
   
  
  
  
  1.6       +0 -10     xml-cocoon2/src/org/apache/cocoon/sitemap/sitemap.roles
  
  Index: sitemap.roles
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/sitemap.roles,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- sitemap.roles	2001/11/09 05:33:48	1.5
  +++ sitemap.roles	2001/12/10 12:56:23	1.6
  @@ -13,16 +13,6 @@
   ]>
   
   <role-list>
  - <role name="org.apache.cocoon.components.pipeline.StreamPipeline"
  -       shorthand="stream-pipeline"
  -       default-class="org.apache.cocoon.components.pipeline.NonCachingStreamPipeline"/>
  -
  - <role name="org.apache.cocoon.components.pipeline.EventPipeline"
  -       shorthand="event-pipeline"
  -       default-class="org.apache.cocoon.components.pipeline.NonCachingEventPipeline"/>
  -
  - <role name="org.apache.cocoon.components.saxconnector.SAXConnector"
  -       shorthand="sax-connector"/>
   
    <role name="org.apache.cocoon.acting.ActionSelector"
          shorthand="action"
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message