类 AnnotationJCacheOperationSource
- java.lang.Object
- org.springframework.cache.jcache.interceptor.AbstractFallbackJCacheOperationSource
- org.springframework.cache.jcache.interceptor.AnnotationJCacheOperationSource
- 所有已实现的接口:
JCacheOperationSource
- 直接已知子类:
DefaultJCacheOperationSource
public abstract class AnnotationJCacheOperationSource extends AbstractFallbackJCacheOperationSource
Implementation of theJCacheOperationSource
interface that reads the JSR-107CacheResult
,CachePut
,CacheRemove
andCacheRemoveAll
annotations.- 从以下版本开始:
- 4.1
- 作者:
- Stephane Nicoll
字段概要
从类继承的字段 org.springframework.cache.jcache.interceptor.AbstractFallbackJCacheOperationSource
logger
构造器概要
构造器 构造器 说明 AnnotationJCacheOperationSource()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected org.springframework.cache.jcache.interceptor.CachePutOperation
createCachePutOperation(Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CachePut ann)
protected org.springframework.cache.jcache.interceptor.CacheRemoveAllOperation
createCacheRemoveAllOperation(Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CacheRemoveAll ann)
protected org.springframework.cache.jcache.interceptor.CacheRemoveOperation
createCacheRemoveOperation(Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CacheRemove ann)
protected org.springframework.cache.jcache.interceptor.CacheResultOperation
createCacheResultOperation(Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CacheResult ann)
protected String
determineCacheName(Method method, javax.cache.annotation.CacheDefaults defaults, String candidate)
protected javax.cache.annotation.CacheResolverFactory
determineCacheResolverFactory(javax.cache.annotation.CacheDefaults defaults, Class<? extends javax.cache.annotation.CacheResolverFactory> candidate)
protected KeyGenerator
determineKeyGenerator(javax.cache.annotation.CacheDefaults defaults, Class<? extends javax.cache.annotation.CacheKeyGenerator> candidate)
protected JCacheOperation<?>
findCacheOperation(Method method, Class<?> targetType)
Subclasses need to implement this to return the caching operation for the given method, if any.protected String
generateDefaultCacheName(Method method)
Generate a default cache name for the specifiedMethod
.protected abstract <T> T
getBean(Class<T> type)
Locate or create an instance of the specified cache strategytype
.protected javax.cache.annotation.CacheDefaults
getCacheDefaults(Method method, Class<?> targetType)
protected CacheResolver
getCacheResolver(javax.cache.annotation.CacheResolverFactory factory, javax.cache.annotation.CacheMethodDetails<?> details)
protected abstract CacheResolver
getDefaultCacheResolver()
Return the defaultCacheResolver
if none is set.protected abstract CacheResolver
getDefaultExceptionCacheResolver()
Return the default exceptionCacheResolver
if none is set.protected abstract KeyGenerator
getDefaultKeyGenerator()
Return the defaultKeyGenerator
if none is set.protected CacheResolver
getExceptionCacheResolver(javax.cache.annotation.CacheResolverFactory factory, javax.cache.annotation.CacheMethodDetails<javax.cache.annotation.CacheResult> details)
从类继承的方法 org.springframework.cache.jcache.interceptor.AbstractFallbackJCacheOperationSource
allowPublicMethodsOnly, getCacheOperation
构造器详细资料
AnnotationJCacheOperationSource
public AnnotationJCacheOperationSource()
方法详细资料
findCacheOperation
protected JCacheOperation<?> findCacheOperation(Method method, Class<?> targetType)
Subclasses need to implement this to return the caching operation for the given method, if any.- 指定者:
findCacheOperation
在类中AbstractFallbackJCacheOperationSource
- 参数:
method
- the method to retrieve the operation fortargetType
- the target class- 返回:
- the cache operation associated with this method (or
null
if none)
getCacheDefaults
protected javax.cache.annotation.CacheDefaults getCacheDefaults(Method method, Class<?> targetType)
createCacheResultOperation
protected org.springframework.cache.jcache.interceptor.CacheResultOperation createCacheResultOperation(Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CacheResult ann)
createCachePutOperation
protected org.springframework.cache.jcache.interceptor.CachePutOperation createCachePutOperation(Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CachePut ann)
createCacheRemoveOperation
protected org.springframework.cache.jcache.interceptor.CacheRemoveOperation createCacheRemoveOperation(Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CacheRemove ann)
createCacheRemoveAllOperation
protected org.springframework.cache.jcache.interceptor.CacheRemoveAllOperation createCacheRemoveAllOperation(Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CacheRemoveAll ann)
getCacheResolver
protected CacheResolver getCacheResolver(javax.cache.annotation.CacheResolverFactory factory, javax.cache.annotation.CacheMethodDetails<?> details)
getExceptionCacheResolver
protected CacheResolver getExceptionCacheResolver(javax.cache.annotation.CacheResolverFactory factory, javax.cache.annotation.CacheMethodDetails<javax.cache.annotation.CacheResult> details)
determineCacheResolverFactory
protected javax.cache.annotation.CacheResolverFactory determineCacheResolverFactory(javax.cache.annotation.CacheDefaults defaults, Class<? extends javax.cache.annotation.CacheResolverFactory> candidate)
determineKeyGenerator
protected KeyGenerator determineKeyGenerator(javax.cache.annotation.CacheDefaults defaults, Class<? extends javax.cache.annotation.CacheKeyGenerator> candidate)
determineCacheName
protected String determineCacheName(Method method, javax.cache.annotation.CacheDefaults defaults, String candidate)
generateDefaultCacheName
protected String generateDefaultCacheName(Method method)
Generate a default cache name for the specifiedMethod
.- 参数:
method
- the annotated method- 返回:
- the default cache name, according to JSR-107
getBean
protected abstract <T> T getBean(Class<T> type)
Locate or create an instance of the specified cache strategytype
.- 参数:
type
- the type of the bean to manage- 返回:
- the required bean
getDefaultCacheResolver
protected abstract CacheResolver getDefaultCacheResolver()
Return the defaultCacheResolver
if none is set.
getDefaultExceptionCacheResolver
protected abstract CacheResolver getDefaultExceptionCacheResolver()
Return the default exceptionCacheResolver
if none is set.
getDefaultKeyGenerator
protected abstract KeyGenerator getDefaultKeyGenerator()
Return the defaultKeyGenerator
if none is set.