CacheOperationSource interface for working with caching metadata in annotation format.
This class reads Spring's Cacheable, CachePut and CacheEvict
annotations and exposes corresponding caching operation definition to Spring's cache
infrastructure. This class may also serve as base class for a custom
CacheOperationSource.
| Modifier and Type | Class and Description |
|---|---|
| protected static interface | AnnotationCacheOperationSource.
Callback interface providing |
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | AnnotationCacheOperationSource()
Create a default AnnotationCacheOperationSource, supporting public methods
that carry the |
| public | AnnotationCacheOperationSource(boolean
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) publicMethodsOnly)Create a default |
| public | AnnotationCacheOperationSource(CacheAnnotationParser
the CacheAnnotationParser to use annotationParser)Create a custom AnnotationCacheOperationSource. |
| public | AnnotationCacheOperationSource(CacheAnnotationParser...
the CacheAnnotationParser to use annotationParsers)Create a custom AnnotationCacheOperationSource. |
| public | AnnotationCacheOperationSource(Set<CacheAnnotationParser>
the CacheAnnotationParser to use annotationParsers)Create a custom AnnotationCacheOperationSource. |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | allowPublicMethodsOnly()
Overrides org. By default, only public methods can be made cacheable. |
| protected Collection | Returns: the configured caching operations, ornull if none foundthe cache operation provider to use providerDetermine the cache operation(s) for the given |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| protected Collection | findCacheOperations(Class<?>
the class to retrieve the attribute for clazz)Implements abstract org. Subclasses need to implement this to return the caching attribute for the given class, if any. |
| protected Collection | findCacheOperations(Method
the method to retrieve the attribute for method)Implements abstract org. Subclasses need to implement this to return the caching attribute for the given method, if any. |
| public int | |
| public boolean | isCandidateClass(Class<?>
the class to introspect targetClass)Overrides default org. Determine whether the given class is a candidate for cache operations
in the metadata format of this |
| annotationParsers | back to summary |
|---|---|
| private final Set<CacheAnnotationParser> annotationParsers | |
| publicMethodsOnly | back to summary |
|---|---|
| private final boolean publicMethodsOnly | |
| AnnotationCacheOperationSource | back to summary |
|---|---|
| public AnnotationCacheOperationSource() Create a default AnnotationCacheOperationSource, supporting public methods
that carry the | |
| AnnotationCacheOperationSource | back to summary |
|---|---|
| public AnnotationCacheOperationSource(boolean publicMethodsOnly) Create a default
| |
| AnnotationCacheOperationSource | back to summary |
|---|---|
| public AnnotationCacheOperationSource(CacheAnnotationParser annotationParser) Create a custom AnnotationCacheOperationSource.
| |
| AnnotationCacheOperationSource | back to summary |
|---|---|
| public AnnotationCacheOperationSource(CacheAnnotationParser... annotationParsers) Create a custom AnnotationCacheOperationSource.
| |
| AnnotationCacheOperationSource | back to summary |
|---|---|
| public AnnotationCacheOperationSource(Set<CacheAnnotationParser> annotationParsers) Create a custom AnnotationCacheOperationSource.
| |
| allowPublicMethodsOnly | back to summary |
|---|---|
| protected boolean allowPublicMethodsOnly() Overrides org. By default, only public methods can be made cacheable.
| |
| determineCacheOperations | back to summary |
|---|---|
| protected Collection Determine the cache operation(s) for the given This implementation delegates to configured
Can be overridden to support custom annotations that carry caching metadata.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| findCacheOperations | back to summary |
|---|---|
| protected Collection Implements abstract org. Doc from org. Subclasses need to implement this to return the caching attribute for the given class, if any.
| |
| findCacheOperations | back to summary |
|---|---|
| protected Collection Implements abstract org. Doc from org. Subclasses need to implement this to return the caching attribute for the given method, if any.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isCandidateClass | back to summary |
|---|---|
| public boolean isCandidateClass(Class<?> targetClass) Overrides default org. Doc from org. Determine whether the given class is a candidate for cache operations
in the metadata format of this If this method returns | |
CacheOperation instance(s) based on
a given CacheAnnotationParser.
| Modifier and Type | Method and Description |
|---|---|
| public Collection | Returns: the cache operations, ornull if none foundthe parser to use parser)Return the |
| getCacheOperations | back to summary |
|---|---|
| public Collection Return the
| |