类 AnnotationCacheOperationSource
- 所有已实现的接口:
CacheOperationSource,Serializable
CacheOperationSource interface for working with caching metadata in annotation format.
This class reads Framework's Cacheable, CachePut and CacheEvict
annotations and exposes corresponding caching operation definition to Framework's cache
infrastructure. This class may also serve as base class for a custom
CacheOperationSource.
- 从以下版本开始:
- 4.0
- 作者:
- Costin Leau, Juergen Hoeller, Stephane Nicoll
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明protected static interfaceCallback interface providingCacheOperationinstance(s) based on a givenCacheAnnotationParser. -
字段概要
从类继承的字段 cn.taketoday.cache.interceptor.AbstractFallbackCacheOperationSource
logger -
构造器概要
构造器构造器说明Create a default AnnotationCacheOperationSource, supporting public methods that carry theCacheableandCacheEvictannotations.AnnotationCacheOperationSource(boolean publicMethodsOnly) Create a defaultAnnotationCacheOperationSource, supporting public methods that carry theCacheableandCacheEvictannotations.AnnotationCacheOperationSource(CacheAnnotationParser annotationParser) Create a custom AnnotationCacheOperationSource.AnnotationCacheOperationSource(CacheAnnotationParser... annotationParsers) Create a custom AnnotationCacheOperationSource.AnnotationCacheOperationSource(Set<CacheAnnotationParser> annotationParsers) Create a custom AnnotationCacheOperationSource. -
方法概要
修饰符和类型方法说明protected booleanBy default, only public methods can be made cacheable.protected Collection<CacheOperation>Determine the cache operation(s) for the givenAnnotationCacheOperationSource.CacheOperationProvider.booleanprotected Collection<CacheOperation>findCacheOperations(Class<?> clazz) Subclasses need to implement this to return the caching attribute for the given class, if any.protected Collection<CacheOperation>findCacheOperations(Method method) Subclasses need to implement this to return the caching attribute for the given method, if any.inthashCode()booleanisCandidateClass(Class<?> targetClass) Determine whether the given class is a candidate for cache operations in the metadata format of thisCacheOperationSource.从类继承的方法 cn.taketoday.cache.interceptor.AbstractFallbackCacheOperationSource
getCacheKey, getCacheOperations
-
构造器详细资料
-
AnnotationCacheOperationSource
public AnnotationCacheOperationSource()Create a default AnnotationCacheOperationSource, supporting public methods that carry theCacheableandCacheEvictannotations. -
AnnotationCacheOperationSource
public AnnotationCacheOperationSource(boolean publicMethodsOnly) Create a defaultAnnotationCacheOperationSource, supporting public methods that carry theCacheableandCacheEvictannotations.- 参数:
publicMethodsOnly- whether to support only annotated public methods typically for use with proxy-based AOP), or protected/private methods as well (typically used with AspectJ class weaving)
-
AnnotationCacheOperationSource
Create a custom AnnotationCacheOperationSource.- 参数:
annotationParser- the CacheAnnotationParser to use
-
AnnotationCacheOperationSource
Create a custom AnnotationCacheOperationSource.- 参数:
annotationParsers- the CacheAnnotationParser to use
-
AnnotationCacheOperationSource
Create a custom AnnotationCacheOperationSource.- 参数:
annotationParsers- the CacheAnnotationParser to use
-
-
方法详细资料
-
isCandidateClass
从接口复制的说明:CacheOperationSourceDetermine whether the given class is a candidate for cache operations in the metadata format of thisCacheOperationSource.If this method returns
false, the methods on the given class will not get traversed forCacheOperationSource.getCacheOperations(java.lang.reflect.Method, java.lang.Class<?>)introspection. Returningfalseis therefore an optimization for non-affected classes, whereastruesimply means that the class needs to get fully introspected for each method on the given class individually.- 指定者:
isCandidateClass在接口中CacheOperationSource- 参数:
targetClass- the class to introspect- 返回:
falseif the class is known to have no cache operation metadata at class or method level;trueotherwise. The default implementation returnstrue, leading to regular introspection.
-
findCacheOperations
从类复制的说明:AbstractFallbackCacheOperationSourceSubclasses need to implement this to return the caching attribute for the given class, if any.- 指定者:
findCacheOperations在类中AbstractFallbackCacheOperationSource- 参数:
clazz- the class to retrieve the attribute for- 返回:
- all caching attribute associated with this class, or
nullif none
-
findCacheOperations
从类复制的说明:AbstractFallbackCacheOperationSourceSubclasses need to implement this to return the caching attribute for the given method, if any.- 指定者:
findCacheOperations在类中AbstractFallbackCacheOperationSource- 参数:
method- the method to retrieve the attribute for- 返回:
- all caching attribute associated with this method, or
nullif none
-
determineCacheOperations
@Nullable protected Collection<CacheOperation> determineCacheOperations(AnnotationCacheOperationSource.CacheOperationProvider provider) Determine the cache operation(s) for the givenAnnotationCacheOperationSource.CacheOperationProvider.This implementation delegates to configured
CacheAnnotationParsersfor parsing known annotations into Framework's metadata attribute class.Can be overridden to support custom annotations that carry caching metadata.
- 参数:
provider- the cache operation provider to use- 返回:
- the configured caching operations, or
nullif none found
-
allowPublicMethodsOnly
protected boolean allowPublicMethodsOnly()By default, only public methods can be made cacheable. -
equals
-
hashCode
public int hashCode()
-