public abstract class AbstractFallbackJCacheOperationSource extends java.lang.Object implements JCacheOperationSource
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.
AbstractFallbackCacheOperationSource
Constructor and Description |
---|
AbstractFallbackJCacheOperationSource() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowPublicMethodsOnly()
Should only public methods be allowed to have caching semantics?
|
protected abstract JCacheOperation<?> |
findCacheOperation(java.lang.reflect.Method method,
java.lang.Class<?> targetType)
Subclasses need to implement this to return the caching operation
for the given method, if any.
|
JCacheOperation<?> |
getCacheOperation(java.lang.reflect.Method method,
java.lang.Class<?> targetClass)
Return the cache operations for this method, or
null
if the method contains no JSR-107 related metadata. |
protected final Log logger
public AbstractFallbackJCacheOperationSource()
public JCacheOperation<?> getCacheOperation(java.lang.reflect.Method method, @Nullable java.lang.Class<?> targetClass)
JCacheOperationSource
null
if the method contains no JSR-107 related metadata.getCacheOperation
in interface JCacheOperationSource
method
- the method to introspecttargetClass
- the target class (may be null
, in which case
the declaring class of the method must be used)null
if none found@Nullable protected abstract JCacheOperation<?> findCacheOperation(java.lang.reflect.Method method, @Nullable java.lang.Class<?> targetType)
method
- the method to retrieve the operation fortargetType
- the target classnull
if none)protected boolean allowPublicMethodsOnly()
The default implementation returns false
.