List of usage examples for org.springframework.cache.interceptor CacheOperationExpressionEvaluator RESULT_UNAVAILABLE
Object RESULT_UNAVAILABLE
To view the source code for org.springframework.cache.interceptor CacheOperationExpressionEvaluator RESULT_UNAVAILABLE.
Click Source Link
From source file:org.springframework.cache.interceptor.CacheAspectSupport.java
private boolean hasCachePut(CacheOperationContexts contexts) { // Evaluate the conditions *without* the result object because we don't have it yet... Collection<CacheOperationContext> cachePutContexts = contexts.get(CachePutOperation.class); Collection<CacheOperationContext> excluded = new ArrayList<>(); for (CacheOperationContext context : cachePutContexts) { try {/*from ww w .j a va2 s .co m*/ if (!context.isConditionPassing(CacheOperationExpressionEvaluator.RESULT_UNAVAILABLE)) { excluded.add(context); } } catch (VariableNotAvailableException ex) { // Ignoring failure due to missing result, consider the cache put has to proceed } } // Check if all puts have been excluded by condition return (cachePutContexts.size() != excluded.size()); }