boolean trace = log.isTraceEnabled();
boolean updateRequired = false;
boolean atLeastOne = false;
ValueWrapper valueWrapper = null;
for (CacheOperationContext context : cacheables) {
if (context.isConditionPassing()) {
atLeastOne = true;
Object key = context.generateKey();
if (trace) {
log.trace("Computed cache key {} for operation {}", new Object[] { key, context.operation });
}
if (key == null) {
throw new IllegalArgumentException(
"Null key returned for cache operation (maybe you are using named params on classes without debug info?) " +
context.operation);
}
// add op/key (in case an update is discovered later on)
cUpdates.put(context, key);
boolean localCacheHit = false;
// check whether the cache needs to be inspected or not (the method will be invoked anyway)
if (!updateRequired) {
for (Cache cache : context.getCaches()) {
ValueWrapper wrapper = cache.get(key);
if (wrapper != null) {
valueWrapper = wrapper;
localCacheHit = true;
break;
}