You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2001/05/14 11:16:22 UTC
cvs commit: xml-cocoon2/src/org/apache/cocoon/components/pipeline CachingEventPipeline.java
cziegeler 01/05/14 02:16:22
Modified: src/org/apache/cocoon/components/pipeline
CachingEventPipeline.java
Log:
Fixed component chaining for caching
Revision Changes Path
1.3 +11 -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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CachingEventPipeline.java 2001/05/10 21:16:45 1.2
+++ CachingEventPipeline.java 2001/05/14 09:16:19 1.3
@@ -53,7 +53,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.2 $ $Date: 2001/05/10 21:16:45 $
+ * @version CVS $Revision: 1.3 $ $Date: 2001/05/14 09:16:19 $
*/
public final class CachingEventPipeline
extends AbstractEventPipeline
@@ -313,6 +313,8 @@
XMLConsumer next;
try {
+ int cacheableTransformerCount = this.firstNotCacheableTransformerIndex;
+
Iterator itt = usedTransformers.iterator();
while ( itt.hasNext() ) {
// connect SAXConnector
@@ -326,11 +328,14 @@
// Connect next component.
next = (XMLConsumer) itt.next();
- if (xmlSerializer != null
- && next instanceof Cacheable == false) {
- next = new XMLTeePipe(next,
+ if (xmlSerializer != null) {
+ if (cacheableTransformerCount == 0) {
+ next = new XMLTeePipe(next,
(XMLConsumer)xmlSerializer);
- xmlSerializer = null;
+ xmlSerializer = null;
+ } else {
+ cacheableTransformerCount--;
+ }
}
prev.setConsumer(next);
prev = (XMLProducer) next;
@@ -353,6 +358,7 @@
xmlSerializer = null;
}
prev.setConsumer(next);
+
} catch ( IOException e ) {
throw new ProcessingException(
"Could not connect pipeline.",
----------------------------------------------------------------------
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