cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1355056 - /cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateTransformer.java
Date Thu, 28 Jun 2012 15:52:30 GMT
Author: ilgrosso
Date: Thu Jun 28 15:52:29 2012
New Revision: 1355056

URL: http://svn.apache.org/viewvc?rev=1355056&view=rev
Log:
Making StringTemplateTransformer cacheable (using new sitemap-related feature from ParamCacheKey)

Modified:
    cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateTransformer.java

Modified: cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateTransformer.java?rev=1355056&r1=1355055&r2=1355056&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateTransformer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateTransformer.java
Thu Jun 28 15:52:29 2012
@@ -18,13 +18,16 @@ package org.apache.cocoon.stringtemplate
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
+import org.apache.cocoon.pipeline.caching.CacheKey;
+import org.apache.cocoon.pipeline.caching.ParameterCacheKey;
+import org.apache.cocoon.pipeline.component.CachingPipelineComponent;
 import org.apache.cocoon.sax.AbstractSAXTransformer;
 import org.apache.cocoon.sax.util.XMLUtils;
 import org.apache.cocoon.xml.sax.SAXBuffer;
 import org.apache.commons.io.output.ByteArrayOutputStream;
 import org.xml.sax.SAXException;
 
-public class StringTemplateTransformer extends AbstractSAXTransformer {
+public class StringTemplateTransformer extends AbstractSAXTransformer implements CachingPipelineComponent
{
 
     private Map<String, Object> parameters = new HashMap<String, Object>();
 
@@ -41,6 +44,11 @@ public class StringTemplateTransformer e
     }
 
     @Override
+    public CacheKey constructCacheKey() {
+        return new ParameterCacheKey().setSitemapParameters(this.parameters);
+    }
+
+    @Override
     public void startDocument()
             throws SAXException {
 



Mime
View raw message