(cocoon 2.0.x but should apply roughly to 2.1 as well), hope it helps your understanding
public long generateKey() {
StringBuffer cacheKey = new StringBuffer();
Request request = ObjectModelHelper.getRequest(objectModel);
cacheKey.append(request.getRequestURI());Enumeration parameterNames = request.getParameterNames();
while (parameterNames.hasMoreElements()) {
String parameterName = (String)parameterNames.nextElement();
String[] values = request.getParameterValues(parameterName);
cacheKey.append(parameterName); for (int i = 0; i < values.length; i++) {
cacheKey.append(values[i]);
}
}
} long key = HashUtil.hash(cacheKey);
logger.debug("cachekey is: " + Long.toString(key));
this.timestamp = key;
return HashUtil.hash(cacheKey);
}public CacheValidity generateValidity() { //always cache
return NOPCacheValidity.CACHE_VALIDITY;
}HTH Jorg
Lionel Crine wrote:
THanks.
But how can I implements caching into my own transformer ? What would be the best to generate the key and to create the validity ?
I took example from FileGenerator. I hope it will be enough to set the validity.
I'll make some tests.
Lionel
At 14:52 08/06/2004 +0200, you wrote:
In 2.0.x you need to make sure that the components your pipeline consists of implement Cacheable.
I believe in 2.1.x it is enough to declare <map:pipeline type="caching"> for your pipeline to be cached/cacheable.
HTH Jorg
Lionel Crine wrote:
Hi,
I'd like to cache A pipeline, where can i find documentation implementing that.
Thanks.
Lionel CRINE Ing�nieur Syst�mes documentaires Soci�t� : 4DConcept 22 rue Etienne de Jouy 78353 JOUY EN JOSAS Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Lionel CRINE Ing�nieur Syst�mes documentaires Soci�t� : 4DConcept 22 rue Etienne de Jouy 78353 JOUY EN JOSAS Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
