public class AnnotationL2CacheOperationSource extends AbstractL2CacheOperationSource implements Serializable
| 限定符和类型 | 类和说明 |
|---|---|
protected static interface |
AnnotationL2CacheOperationSource.L2CacheOperationProvider
Callback interface providing
CacheOperation instance(s) based on
a given CacheAnnotationParser. |
| 限定符和类型 | 字段和说明 |
|---|---|
private Set<L2CacheAnnotationParser> |
annotationParsers |
private boolean |
publicMethodsOnly |
| 构造器和说明 |
|---|
AnnotationL2CacheOperationSource()
Create a default AnnotationCacheOperationSource, supporting public methods
that carry the
Cacheable and CacheEvict annotations. |
AnnotationL2CacheOperationSource(boolean publicMethodsOnly)
Create a default
AnnotationCacheOperationSource, supporting public methods
that carry the Cacheable and CacheEvict annotations. |
AnnotationL2CacheOperationSource(L2CacheAnnotationParser... annotationParsers)
Create a custom AnnotationCacheOperationSource.
|
AnnotationL2CacheOperationSource(L2CacheAnnotationParser annotationParser)
Create a custom AnnotationCacheOperationSource.
|
AnnotationL2CacheOperationSource(Set<L2CacheAnnotationParser> annotationParsers)
Create a custom AnnotationCacheOperationSource.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
allowPublicMethodsOnly()
By default, only public methods can be made cacheable.
|
protected Collection<L2CacheOperation> |
determineCacheOperations(AnnotationL2CacheOperationSource.L2CacheOperationProvider provider)
Determine the cache operation(s) for the given
AnnotationL2CacheOperationSource.L2CacheOperationProvider. |
boolean |
equals(Object other) |
protected Collection<L2CacheOperation> |
findCacheOperations(Class<?> clazz)
Subclasses need to implement this to return the caching attribute for the
given class, if any.
|
protected Collection<L2CacheOperation> |
findCacheOperations(Method method)
Subclasses need to implement this to return the caching attribute for the
given method, if any.
|
int |
hashCode() |
boolean |
isCandidateClass(Class<?> targetClass)
是否是候选类
|
getCacheKey, getCacheOperationsprivate final boolean publicMethodsOnly
private final Set<L2CacheAnnotationParser> annotationParsers
public AnnotationL2CacheOperationSource()
Cacheable and CacheEvict annotations.public AnnotationL2CacheOperationSource(boolean publicMethodsOnly)
AnnotationCacheOperationSource, supporting public methods
that carry the Cacheable and CacheEvict annotations.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)public AnnotationL2CacheOperationSource(L2CacheAnnotationParser annotationParser)
annotationParser - the CacheAnnotationParser to usepublic AnnotationL2CacheOperationSource(L2CacheAnnotationParser... annotationParsers)
annotationParsers - the CacheAnnotationParser to usepublic AnnotationL2CacheOperationSource(Set<L2CacheAnnotationParser> annotationParsers)
annotationParsers - the CacheAnnotationParser to usepublic boolean isCandidateClass(Class<?> targetClass)
L2CacheOperationSourceisCandidateClass 在接口中 L2CacheOperationSourcetargetClass - 目标类protected Collection<L2CacheOperation> findCacheOperations(Class<?> clazz)
AbstractL2CacheOperationSourcefindCacheOperations 在类中 AbstractL2CacheOperationSourceclazz - the class to retrieve the attribute fornull if noneprotected Collection<L2CacheOperation> findCacheOperations(Method method)
AbstractL2CacheOperationSourcefindCacheOperations 在类中 AbstractL2CacheOperationSourcemethod - the method to retrieve the attribute fornull if none@Nullable protected Collection<L2CacheOperation> determineCacheOperations(AnnotationL2CacheOperationSource.L2CacheOperationProvider provider)
AnnotationL2CacheOperationSource.L2CacheOperationProvider.
This implementation delegates to configured
CacheAnnotationParsers
for parsing known annotations into Spring's metadata attribute class.
Can be overridden to support custom annotations that carry caching metadata.
provider - the cache operation provider to usenull if none foundprotected boolean allowPublicMethodsOnly()
Copyright © 2023. All rights reserved.