@Override
public void onComplete() {
if (currentSize < cache.getMaxSizeCacheEntry()) {
try {
interaction.setRequest(new HttpRequest(headerCopy, bodyCopy));
} catch (IOException ioe) {
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("error occured by creating/registering cachedResponse " + ioe.toString());
}
}
} else {
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("do not cache interaction (to large or request not complete)");
}
}
}
};
dataSource.setDataHandler(bodyForwarder);
} else {
interaction.setRequest(new HttpRequest(headerCopy));
ForwarderResponseHandler forwardResponseHandler = new ForwarderResponseHandler(interaction, exchange);
exchange.forward(exchange.getRequest(), forwardResponseHandler);
}
}