1 16 package org.apache.cocoon.caching; 17 18 import org.apache.excalibur.source.SourceValidity; 19 20 29 public final class SourceCacheValidity 30 implements CacheValidity { 31 32 protected SourceValidity sourceValidity; 33 34 37 public SourceCacheValidity(SourceValidity validity) { 38 this.sourceValidity = validity; 39 } 40 41 46 public boolean isValid(CacheValidity validity) { 47 final int valid = this.sourceValidity.isValid(); 48 if (valid == 1) return true; 49 if (valid == 0 && validity instanceof SourceCacheValidity) { 50 if (this.sourceValidity.isValid(((SourceCacheValidity)validity).getSourceValidity()) == 1) { 51 return true; 52 } 53 54 } 55 return false; 56 } 57 58 61 public SourceValidity getSourceValidity() { 62 return this.sourceValidity; 63 } 64 65 public String toString() { 66 return "Source Validity[" + this.sourceValidity + ']'; 67 } 68 } 69 | Popular Tags |