public abstract class AnnotationJCacheOperationSource extends AbstractFallbackJCacheOperationSource
JCacheOperationSource
interface that reads
the JSR-107 CacheResult
, CachePut
, CacheRemove
and
CacheRemoveAll
annotations.logger
Constructor and Description |
---|
AnnotationJCacheOperationSource() |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.cache.jcache.interceptor.CachePutOperation |
createCachePutOperation(java.lang.reflect.Method method,
javax.cache.annotation.CacheDefaults defaults,
javax.cache.annotation.CachePut ann) |
protected org.springframework.cache.jcache.interceptor.CacheRemoveAllOperation |
createCacheRemoveAllOperation(java.lang.reflect.Method method,
javax.cache.annotation.CacheDefaults defaults,
javax.cache.annotation.CacheRemoveAll ann) |
protected org.springframework.cache.jcache.interceptor.CacheRemoveOperation |
createCacheRemoveOperation(java.lang.reflect.Method method,
javax.cache.annotation.CacheDefaults defaults,
javax.cache.annotation.CacheRemove ann) |
protected org.springframework.cache.jcache.interceptor.CacheResultOperation |
createCacheResultOperation(java.lang.reflect.Method method,
javax.cache.annotation.CacheDefaults defaults,
javax.cache.annotation.CacheResult ann) |
protected java.lang.String |
determineCacheName(java.lang.reflect.Method method,
javax.cache.annotation.CacheDefaults defaults,
java.lang.String candidate) |
protected javax.cache.annotation.CacheResolverFactory |
determineCacheResolverFactory(javax.cache.annotation.CacheDefaults defaults,
java.lang.Class<? extends javax.cache.annotation.CacheResolverFactory> candidate) |
protected org.springframework.cache.interceptor.KeyGenerator |
determineKeyGenerator(javax.cache.annotation.CacheDefaults defaults,
java.lang.Class<? extends javax.cache.annotation.CacheKeyGenerator> candidate) |
protected 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.
|
protected java.lang.String |
generateDefaultCacheName(java.lang.reflect.Method method)
Generate a default cache name for the specified
Method . |
protected abstract <T> T |
getBean(java.lang.Class<T> type)
Locate or create an instance of the specified cache strategy
type . |
protected javax.cache.annotation.CacheDefaults |
getCacheDefaults(java.lang.reflect.Method method,
java.lang.Class<?> targetType) |
protected org.springframework.cache.interceptor.CacheResolver |
getCacheResolver(javax.cache.annotation.CacheResolverFactory factory,
javax.cache.annotation.CacheMethodDetails<?> details) |
protected abstract org.springframework.cache.interceptor.CacheResolver |
getDefaultCacheResolver()
Return the default
CacheResolver if none is set. |
protected abstract org.springframework.cache.interceptor.CacheResolver |
getDefaultExceptionCacheResolver()
Return the default exception
CacheResolver if none is set. |
protected abstract org.springframework.cache.interceptor.KeyGenerator |
getDefaultKeyGenerator()
Return the default
KeyGenerator if none is set. |
protected org.springframework.cache.interceptor.CacheResolver |
getExceptionCacheResolver(javax.cache.annotation.CacheResolverFactory factory,
javax.cache.annotation.CacheMethodDetails<javax.cache.annotation.CacheResult> details) |
allowPublicMethodsOnly, getCacheOperation
protected JCacheOperation<?> findCacheOperation(java.lang.reflect.Method method, java.lang.Class<?> targetType)
AbstractFallbackJCacheOperationSource
findCacheOperation
in class AbstractFallbackJCacheOperationSource
method
- the method to retrieve the operation fortargetType
- the target classnull
if none)protected javax.cache.annotation.CacheDefaults getCacheDefaults(java.lang.reflect.Method method, java.lang.Class<?> targetType)
protected org.springframework.cache.jcache.interceptor.CacheResultOperation createCacheResultOperation(java.lang.reflect.Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CacheResult ann)
protected org.springframework.cache.jcache.interceptor.CachePutOperation createCachePutOperation(java.lang.reflect.Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CachePut ann)
protected org.springframework.cache.jcache.interceptor.CacheRemoveOperation createCacheRemoveOperation(java.lang.reflect.Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CacheRemove ann)
protected org.springframework.cache.jcache.interceptor.CacheRemoveAllOperation createCacheRemoveAllOperation(java.lang.reflect.Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CacheRemoveAll ann)
protected org.springframework.cache.interceptor.CacheResolver getCacheResolver(javax.cache.annotation.CacheResolverFactory factory, javax.cache.annotation.CacheMethodDetails<?> details)
protected org.springframework.cache.interceptor.CacheResolver getExceptionCacheResolver(javax.cache.annotation.CacheResolverFactory factory, javax.cache.annotation.CacheMethodDetails<javax.cache.annotation.CacheResult> details)
@Nullable protected javax.cache.annotation.CacheResolverFactory determineCacheResolverFactory(javax.cache.annotation.CacheDefaults defaults, java.lang.Class<? extends javax.cache.annotation.CacheResolverFactory> candidate)
protected org.springframework.cache.interceptor.KeyGenerator determineKeyGenerator(javax.cache.annotation.CacheDefaults defaults, java.lang.Class<? extends javax.cache.annotation.CacheKeyGenerator> candidate)
protected java.lang.String determineCacheName(java.lang.reflect.Method method, javax.cache.annotation.CacheDefaults defaults, java.lang.String candidate)
protected java.lang.String generateDefaultCacheName(java.lang.reflect.Method method)
Method
.method
- the annotated methodprotected abstract <T> T getBean(java.lang.Class<T> type)
type
.type
- the type of the bean to manageprotected abstract org.springframework.cache.interceptor.CacheResolver getDefaultCacheResolver()
CacheResolver
if none is set.protected abstract org.springframework.cache.interceptor.CacheResolver getDefaultExceptionCacheResolver()
CacheResolver
if none is set.protected abstract org.springframework.cache.interceptor.KeyGenerator getDefaultKeyGenerator()
KeyGenerator
if none is set.