Author: unico Date: Wed Nov 17 05:44:01 2004 New Revision: 76129 Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java Log: return NOPValidity for event pipeline when it has not yet expired
Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java Wed Nov 17 05:44:01 2004 @@ -34,6 +34,7 @@ import org.apache.excalibur.source.SourceValidity; import org.apache.excalibur.source.impl.validity.AggregatedValidity; import org.apache.excalibur.source.impl.validity.DeferredValidity; +import org.apache.excalibur.source.impl.validity.NOPValidity; import java.io.ByteArrayOutputStream; import java.io.OutputStream; @@ -801,13 +802,20 @@ * Otherwise return <code>null</code> */ public SourceValidity getValidityForEventPipeline() { - if (this.cachedResponse != null && this.toCacheSourceValidities != null) { - final AggregatedValidity validity = new AggregatedValidity(); - for (int i=0; i < this.toCacheSourceValidities.length; i++) { - validity.add(this.toCacheSourceValidities[i]); + if (this.cachedResponse != null) { + if (this.toCacheSourceValidities != null) { + // This means that the pipeline is valid based on the validities + // of the individual components + final AggregatedValidity validity = new AggregatedValidity(); + for (int i=0; i < this.toCacheSourceValidities.length; i++) { + validity.add(this.toCacheSourceValidities[i]); + } + return validity; + } + else { + // This means that the pipeline is valid because it has not yet expired + return NOPValidity.SHARED_INSTANCE; } - return validity; - } else { int vals = 0;