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(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 specified
Method. |
protected abstract <T> T |
getBean(Class<T> type)
Locate or create an instance of the specified cache strategy
type. |
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 default
CacheResolver if none is set. |
protected abstract CacheResolver |
getDefaultExceptionCacheResolver()
Return the default exception
CacheResolver if none is set. |
protected abstract KeyGenerator |
getDefaultKeyGenerator()
Return the default
KeyGenerator if none is set. |
protected CacheResolver |
getExceptionCacheResolver(javax.cache.annotation.CacheResolverFactory factory,
javax.cache.annotation.CacheMethodDetails<javax.cache.annotation.CacheResult> details) |
allowPublicMethodsOnly, getCacheOperationprotected JCacheOperation<?> findCacheOperation(Method method, Class<?> targetType)
AbstractFallbackJCacheOperationSourcefindCacheOperation in class AbstractFallbackJCacheOperationSourcemethod - the method to retrieve the operation fortargetType - the target classnull if none)protected javax.cache.annotation.CacheDefaults getCacheDefaults(Method method, Class<?> targetType)
protected org.springframework.cache.jcache.interceptor.CacheResultOperation createCacheResultOperation(Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CacheResult ann)
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.CacheRemoveOperation createCacheRemoveOperation(Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CacheRemove ann)
protected org.springframework.cache.jcache.interceptor.CacheRemoveAllOperation createCacheRemoveAllOperation(Method method, javax.cache.annotation.CacheDefaults defaults, javax.cache.annotation.CacheRemoveAll ann)
protected CacheResolver getCacheResolver(javax.cache.annotation.CacheResolverFactory factory, javax.cache.annotation.CacheMethodDetails<?> details)
protected CacheResolver getExceptionCacheResolver(javax.cache.annotation.CacheResolverFactory factory, javax.cache.annotation.CacheMethodDetails<javax.cache.annotation.CacheResult> details)
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 String determineCacheName(Method method, javax.cache.annotation.CacheDefaults defaults, String candidate)
protected String generateDefaultCacheName(Method method)
Method.method - the annotated methodprotected abstract <T> T getBean(Class<T> type)
type.type - the type of the bean to manageprotected abstract CacheResolver getDefaultCacheResolver()
CacheResolver if none is set.protected abstract CacheResolver getDefaultExceptionCacheResolver()
CacheResolver if none is set.protected abstract KeyGenerator getDefaultKeyGenerator()
KeyGenerator if none is set.