cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1347612 - /cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/SchemaProcessorTransformer.java
Date Thu, 07 Jun 2012 13:36:15 GMT
Author: ilgrosso
Date: Thu Jun  7 13:36:15 2012
New Revision: 1347612

URL: http://svn.apache.org/viewvc?rev=1347612&view=rev
Log:
[COCOON3-63] CacheKey based on lastModified

Modified:
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/SchemaProcessorTransformer.java

Modified: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/SchemaProcessorTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/SchemaProcessorTransformer.java?rev=1347612&r1=1347611&r2=1347612&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/SchemaProcessorTransformer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/SchemaProcessorTransformer.java
Thu Jun  7 13:36:15 2012
@@ -25,6 +25,9 @@ import javax.xml.validation.Schema;
 import javax.xml.validation.SchemaFactory;
 import javax.xml.validation.ValidatorHandler;
 import org.apache.cocoon.pipeline.SetupException;
+import org.apache.cocoon.pipeline.caching.CacheKey;
+import org.apache.cocoon.pipeline.caching.TimestampCacheKey;
+import org.apache.cocoon.pipeline.component.CachingPipelineComponent;
 import org.apache.cocoon.pipeline.util.StringRepresentation;
 import org.apache.cocoon.sax.AbstractSAXTransformer;
 import org.apache.cocoon.sax.SAXConsumer;
@@ -36,7 +39,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xml.sax.SAXException;
 
-public final class SchemaProcessorTransformer extends AbstractSAXTransformer {
+public final class SchemaProcessorTransformer extends AbstractSAXTransformer implements CachingPipelineComponent
{
 
     /**
      * Logger.
@@ -115,4 +118,13 @@ public final class SchemaProcessorTransf
             }
         }
     }
+
+    @Override
+    public CacheKey constructCacheKey() {
+        if (this.source == null) {
+            throw new SetupException(this.getClass().getSimpleName() + " has no source.");
+        }
+
+        return new TimestampCacheKey(this.source, URLManipulationUtils.getLastModified(this.source));
+    }
 }



Mime
View raw message