if (this.cacheCompleteResponse) {
if (this.getLogger().isDebugEnabled()) {
this.getLogger().debug("Cached: caching complete response; pSisze"
+ this.toCacheKey.size() + " Key " + this.toCacheKey);
}
CachedResponse response = new CachedResponse(this.toCacheSourceValidities,
((CachingOutputStream)os).getContent());
response.setContentType(environment.getContentType());
this.cache.store(this.toCacheKey.copy(), response);
//
// Scan back along the pipelineCacheKey for
// for any cachepoint(s)
//
this.toCacheKey.removeUntilCachePoint();
//
// adjust the validities object
// to reflect the new length of the pipeline cache key.
//
// REVISIT: Is it enough to simply reduce the length of the validities array?
//
if (this.toCacheKey.size() > 0) {
SourceValidity[] copy = new SourceValidity[this.toCacheKey.size()];
System.arraycopy(this.toCacheSourceValidities, 0, copy, 0, copy.length);
this.toCacheSourceValidities = copy;
}
}
if (this.toCacheKey.size() > 0) {
ListIterator itt = this.xmlSerializerArray.listIterator(this.xmlSerializerArray.size());
while (itt.hasPrevious()) {
XMLSerializer serializer = (XMLSerializer) itt.previous();
CachedResponse response = new CachedResponse(this.toCacheSourceValidities,
(byte[])serializer.getSAXFragment());
this.cache.store(this.toCacheKey.copy(), response);
if (this.getLogger().isDebugEnabled()) {
this.getLogger().debug("Caching results for the following key: "