// use the response from the cache
result = (byte[])object;
}
// stream the content
XMLByteStreamInterpreter deserializer = new XMLByteStreamInterpreter();
deserializer.setConsumer(handler);
deserializer.deserialize(result);
return;
} else {
// we are not processing parallel
// first: test for a cached response
IncludeCacheStorageProxy storage = session.getCacheStorageProxy();
CachedResponse response = (CachedResponse)storage.get(uri);
if ( null != response) {
SourceValidity[] validities = response.getValidityObjects();
// if purging is turned off and either the cached response is valid or
// we are loading preemptive, then use the cached response
if ( !session.isPurging()
&& (session.isPreemptive() || validities[0].isValid() == SourceValidity.VALID)) {
// stream the content
if (this.getLogger().isDebugEnabled()) {
this.getLogger().debug("Streaming from cached response.");
}
XMLByteStreamInterpreter deserializer = new XMLByteStreamInterpreter();
deserializer.setConsumer(handler);
deserializer.deserialize(response.getResponse());
// load preemptive if the response is not valid
if ( session.getExpires() > 0
&& session.isPreemptive()
&& validities[0].isValid() != SourceValidity.VALID) {