|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.cache.interceptor.AbstractFallbackCacheOperationSource
org.springframework.cache.annotation.AnnotationCacheOperationSource
public class AnnotationCacheOperationSource
Implementation of the CacheOperationSource
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 CacheOperationSource.
Field Summary |
---|
Fields inherited from class org.springframework.cache.interceptor.AbstractFallbackCacheOperationSource |
---|
logger |
Constructor Summary | |
---|---|
AnnotationCacheOperationSource()
Create a default AnnotationCacheOperationSource, supporting public methods that carry the Cacheable and CacheEvict
annotations. |
|
AnnotationCacheOperationSource(boolean publicMethodsOnly)
Create a custom AnnotationCacheOperationSource, supporting public methods that carry the Cacheable and
CacheEvict annotations. |
|
AnnotationCacheOperationSource(CacheAnnotationParser... annotationParsers)
Create a custom AnnotationCacheOperationSource. |
Method Summary | |
---|---|
protected boolean |
allowPublicMethodsOnly()
By default, only public methods can be made cacheable. |
protected CacheOperation |
determineCacheOperation(AnnotatedElement ae)
Determine the cache operation definition for the given method or class. |
protected CacheOperation |
findCacheOperation(Class<?> clazz)
Subclasses need to implement this to return the caching attribute for the given class, if any. |
protected CacheOperation |
findCacheOperation(Method method)
Subclasses need to implement this to return the caching attribute for the given method, if any. |
Methods inherited from class org.springframework.cache.interceptor.AbstractFallbackCacheOperationSource |
---|
getCacheKey, getCacheOperation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationCacheOperationSource()
Cacheable
and CacheEvict
annotations.
public AnnotationCacheOperationSource(boolean publicMethodsOnly)
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 AnnotationCacheOperationSource(CacheAnnotationParser... annotationParsers)
annotationParsers
- the CacheAnnotationParser to useMethod Detail |
---|
protected CacheOperation findCacheOperation(Class<?> clazz)
AbstractFallbackCacheOperationSource
findCacheOperation
in class AbstractFallbackCacheOperationSource
clazz
- the class to retrieve the attribute for
null
if none)protected CacheOperation findCacheOperation(Method method)
AbstractFallbackCacheOperationSource
findCacheOperation
in class AbstractFallbackCacheOperationSource
method
- the method to retrieve the attribute for
null
if none)protected CacheOperation determineCacheOperation(AnnotatedElement ae)
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 foundprotected boolean allowPublicMethodsOnly()
allowPublicMethodsOnly
in class AbstractFallbackCacheOperationSource
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |