Class AbstractFallbackJCacheOperationSource
java.lang.Object
org.springframework.cache.jcache.interceptor.AbstractFallbackJCacheOperationSource
- All Implemented Interfaces:
- JCacheOperationSource
- Direct Known Subclasses:
- AnnotationJCacheOperationSource
public abstract class AbstractFallbackJCacheOperationSource
extends Object
implements JCacheOperationSource
Abstract implementation of 
JCacheOperationSource that caches attributes
 for methods and implements a fallback policy: 1. specific target method;
 2. declaring method.
 This implementation caches attributes by method after they are first used.
- Since:
- 4.1
- Author:
- Stephane Nicoll, Juergen Hoeller
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanShould only public methods be allowed to have caching semantics?protected abstract JCacheOperation<?>findCacheOperation(Method method, Class<?> targetType) Subclasses need to implement this to return the caching operation for the given method, if any.getCacheOperation(Method method, Class<?> targetClass) Return the cache operations for this method, ornullif the method contains no JSR-107 related metadata.
- 
Field Details- 
logger
 
- 
- 
Constructor Details- 
AbstractFallbackJCacheOperationSourcepublic AbstractFallbackJCacheOperationSource()
 
- 
- 
Method Details- 
getCacheOperationDescription copied from interface:JCacheOperationSourceReturn the cache operations for this method, ornullif the method contains no JSR-107 related metadata.- Specified by:
- getCacheOperationin interface- JCacheOperationSource
- Parameters:
- method- the method to introspect
- targetClass- the target class (may be- null, in which case the declaring class of the method must be used)
- Returns:
- the cache operation for this method, or nullif none found
 
- 
findCacheOperation@Nullable protected abstract JCacheOperation<?> findCacheOperation(Method method, @Nullable Class<?> targetType) Subclasses need to implement this to return the caching operation for the given method, if any.- Parameters:
- method- the method to retrieve the operation for
- targetType- the target class
- Returns:
- the cache operation associated with this method
 (or nullif none)
 
- 
allowPublicMethodsOnlyprotected boolean allowPublicMethodsOnly()Should only public methods be allowed to have caching semantics?The default implementation returns false.
 
-