cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/impl CachingProcessingPipeline.java
Date Fri, 10 May 2002 08:33:30 GMT
cziegeler    02/05/10 01:33:29

  Modified:    src/java/org/apache/cocoon/components/pipeline/impl
                        CachingProcessingPipeline.java
  Log:
  Some more lines
  
  Revision  Changes    Path
  1.8       +23 -5     xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/impl/CachingProcessingPipeline.java
  
  Index: CachingProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/impl/CachingProcessingPipeline.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CachingProcessingPipeline.java	7 May 2002 06:37:32 -0000	1.7
  +++ CachingProcessingPipeline.java	10 May 2002 08:33:29 -0000	1.8
  @@ -89,7 +89,7 @@
    *
    * @since @next-version@
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Id: CachingProcessingPipeline.java,v 1.7 2002/05/07 06:37:32 cziegeler
Exp $
  + * @version CVS $Id: CachingProcessingPipeline.java,v 1.8 2002/05/10 08:33:29 cziegeler
Exp $
    */
   public class CachingProcessingPipeline
   extends AbstractProcessingPipeline
  @@ -332,7 +332,9 @@
           }
   
           // now, if we have a key, let's see if there is a cached response
  -        if (this.pipelineCacheKey != null) {
  +        boolean finished = false;
  +        while (this.pipelineCacheKey != null && !finished) {
  +            finished = true;
               CachedResponse response = this.cache.get(this.pipelineCacheKey.toString());
               // now test validity
               if (response != null) {
  @@ -350,7 +352,7 @@
                               } else {
                                   validity = new CacheValidityToSourceValidity(((Cacheable)this.generator).generateValidity());
                               }
  -                        } else if (i >= firstNotCacheableTransformerIndex + 1) {
  +                        } else if (i <= firstNotCacheableTransformerIndex + 1) {
                               // test transformer
                               final Transformer trans =
                                  (Transformer)this.transformers.get(i-1);
  @@ -361,8 +363,11 @@
                               }
                           } else {
                               // test serializer
  -                            // FIXME
  -                            validity = null;
  +                            if (serializerIsCacheableProcessingComponent) {
  +                                validity = ((CacheableProcessingComponent)this.serializer).generateValidity();
  +                            } else {
  +                                validity = new CacheValidityToSourceValidity(((Cacheable)this.serializer).generateValidity());
  +                            }
                           }
                           if (validity != null) {
                               isValid = validities[i].isValid( validity );
  @@ -382,6 +387,19 @@
                       if (validities[i] == null) {
                           // we can try a shorter key now...
                           // but we don't invalidate the current entry!
  +                        if (i > 0) {
  +                            int deleteCount = validities.length - i;
  +                            if (i > 0 && i <= firstNotCacheableTransformerIndex
+ 1) {
  +                                this.firstNotCacheableTransformerIndex = i-1;
  +                            }
  +                            for(int x=0; x < deleteCount; x++) {
  +                                final int deletePos = this.pipelineCacheKey.toString().lastIndexOf("CCK:");
  +                                this.pipelineCacheKey.delete(deletePos, this.pipelineCacheKey.length());
  +                            }
  +                            finished = false;
  +                        } else {
  +                            this.pipelineCacheKey = null;
  +                        }
                       } else {
                           // invalidate entry
                           this.cache.remove(this.pipelineCacheKey.toString());
  
  
  

----------------------------------------------------------------------
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