final Cache cache = cpc.getCache(cacheName);
// if properties is null then cacheBody element is used outside
// cache element or cache element has key attribute set, so
// recording process has been already started.
CacheBodyOperationProcess operation =
new CacheBodyOperationProcess();
XMLPipeline pipeline = dynamicProcess.getPipeline();
operation.setCacheName(cacheName);
operation.setCacheKey(properties.getCacheKey());
final CacheControl cacheControl = properties.getCacheControl();
if (cacheControl != null && cacheControl.getTimeToLive() == null) {
// if no TTL period has been set, use the default value for this
// cache
cacheControl.setTimeToLive(cpc.getDefaultTimeToLive(cacheName));
}
operation.setCacheControl(cacheControl);
operation.setPipeline(pipeline);
operation.setCache(cache);
operation.setFixedExpiryMode(properties.isFixedExpiryMode());
operation.setMaxWaitTime(properties.getMaxWaitTime());
try {
CacheBodyOperationProcessState state =
operation.initializeProcessState();
// If there is a cached recorder to playback from then we want
// to suppress all of the content.
if (state == CacheBodyOperationProcessState.
PLAYBACK_AND_SUPPRESS) {