org.apache.cocoon.caching
public final class: IncludeCacheValidity [javadoc |
source]
java.lang.Object
org.apache.cocoon.caching.IncludeCacheValidity
All Implemented Interfaces:
CacheValidity
Deprecated! Use - the Avalon Excalibur SourceValidity implementations instead
A validation object used in CachingCIncludeTransformer
- author:
< - a href="mailto:maciejka@tiger.com.pl">Maciek Kaminski
- version:
CVS - $Id: IncludeCacheValidity.java 433543 2006-08-22 06:22:54Z crossley $
| Method from org.apache.cocoon.caching.IncludeCacheValidity Detail: |
public void add(String source,
long timeStamp) {
this.sources.add(source);
this.timeStamps.add(new Long(timeStamp));
} Deprecated! |
public boolean isNew() {
return isNew;
} Deprecated! |
public boolean isValid(CacheValidity validity) {
if (validity instanceof IncludeCacheValidity) {
SourceResolver otherResolver = ((IncludeCacheValidity) validity).resolver;
for(Iterator i = sources.iterator(), j = timeStamps.iterator(); i.hasNext();) {
String src = ((String)i.next());
long timeStamp = ((Long)j.next()).longValue();
Source otherSource = null;
try {
otherSource = otherResolver.resolveURI(src);
if(otherSource.getLastModified() != timeStamp ||
timeStamp == 0)
return false;
} catch (Exception e) {
return false;
} finally {
otherResolver.release(otherSource);
}
}
return true;
}
return false;
} Deprecated! |
public void setIsNew2False() {
isNew = false;
resolver = null;
} Deprecated! |
public String toString() {
StringBuffer b = new StringBuffer("Include Validity[");
for(Iterator i = sources.iterator(), j = timeStamps.iterator(); i.hasNext();) {
b.append('{");
b.append(i.next());
b.append(':");
b.append(j.next());
b.append('}");
if(i.hasNext()) b.append(':");
}
b.append(']");
return b.toString();
} Deprecated! |