java.lang.Object | ||
↳ | org.springframework.cache.interceptor.AbstractFallbackCacheDefinitionSource | |
↳ | org.springframework.cache.annotation.AnnotationCacheDefinitionSource |
Implementation of the
CacheDefinitionSource
interface for working with caching metadata in JDK 1.5+ annotation format.
This class reads Spring's JDK 1.5+ Cacheable
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 CacheDefinitionSource.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.cache.interceptor.AbstractFallbackCacheDefinitionSource
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a default AnnotationCacheOperationDefinitionSource, supporting
public methods that carry the
Cacheable and CacheInvalidate
annotations. | |||||||||||
Create a custom AnnotationCacheOperationDefinitionSource, supporting
public methods that carry the
Cacheable and
CacheInvalidate annotations. | |||||||||||
Create a custom AnnotationCacheOperationDefinitionSource.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
By default, only public methods can be made cacheable.
| |||||||||||
Determine the cache operation definition for the given method or class.
| |||||||||||
Subclasses need to implement this to return the caching attribute
for the given class, if any.
| |||||||||||
Subclasses need to implement this to return the caching attribute
for the given method, if any.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.cache.interceptor.AbstractFallbackCacheDefinitionSource
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.cache.interceptor.CacheDefinitionSource
|
Create a default AnnotationCacheOperationDefinitionSource, supporting
public methods that carry the Cacheable
and CacheInvalidate
annotations.
Create a custom AnnotationCacheOperationDefinitionSource, supporting
public methods that carry the Cacheable
and
CacheInvalidate
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) |
---|
Create a custom AnnotationCacheOperationDefinitionSource.
annotationParsers | the CacheAnnotationParser to use |
---|
By default, only public methods can be made cacheable.
Determine the cache operation definition for the given method or class.
This implementation delegates to configured
CacheAnnotationParsers
for parsing known annotations into Spring's metadata attribute class.
Returns null
if it's not cacheable.
Can be overridden to support custom annotations that carry caching metadata.
ae | the annotated method or class |
---|
null
if none was found
Subclasses need to implement this to return the caching attribute for the given class, if any.
clazz | the class to retrieve the attribute for |
---|
null
if none)
Subclasses need to implement this to return the caching attribute for the given method, if any.
method | the method to retrieve the attribute for |
---|
null
if none)