|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.cache.interceptor.AbstractFallbackCacheOperationSource org.springframework.cache.annotation.AnnotationCacheOperationSource
public class AnnotationCacheOperationSource
Implementation of the 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
.
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 default AnnotationCacheOperationSource , supporting public methods
that carry the Cacheable and CacheEvict annotations. |
|
AnnotationCacheOperationSource(CacheAnnotationParser... annotationParsers)
Create a custom AnnotationCacheOperationSource. |
|
AnnotationCacheOperationSource(CacheAnnotationParser annotationParser)
Create a custom AnnotationCacheOperationSource. |
|
AnnotationCacheOperationSource(Set<CacheAnnotationParser> annotationParsers)
Create a custom AnnotationCacheOperationSource. |
Method Summary | |
---|---|
protected boolean |
allowPublicMethodsOnly()
By default, only public methods can be made cacheable. |
protected Collection<CacheOperation> |
determineCacheOperations(AnnotatedElement ae)
Determine the cache operation(s) for the given method or class. |
boolean |
equals(Object other)
|
protected 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. |
int |
hashCode()
|
Methods inherited from class org.springframework.cache.interceptor.AbstractFallbackCacheOperationSource |
---|
getCacheKey, getCacheOperations |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationCacheOperationSource()
Cacheable
and CacheEvict
annotations.
public AnnotationCacheOperationSource(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 AnnotationCacheOperationSource(CacheAnnotationParser annotationParser)
annotationParser
- the CacheAnnotationParser to usepublic AnnotationCacheOperationSource(CacheAnnotationParser... annotationParsers)
annotationParsers
- the CacheAnnotationParser to usepublic AnnotationCacheOperationSource(Set<CacheAnnotationParser> annotationParsers)
annotationParsers
- the CacheAnnotationParser to useMethod Detail |
---|
protected Collection<CacheOperation> findCacheOperations(Class<?> clazz)
AbstractFallbackCacheOperationSource
findCacheOperations
in class AbstractFallbackCacheOperationSource
clazz
- the class to retrieve the attribute for
null
if none)protected Collection<CacheOperation> findCacheOperations(Method method)
AbstractFallbackCacheOperationSource
findCacheOperations
in class AbstractFallbackCacheOperationSource
method
- the method to retrieve the attribute for
null
if none)protected Collection<CacheOperation> determineCacheOperations(AnnotatedElement ae)
This implementation delegates to configured
CacheAnnotationParser
s for parsing known annotations into
Spring's metadata attribute class.
Can be overridden to support custom annotations that carry caching metadata.
ae
- the annotated method or class
null
if none foundprotected boolean allowPublicMethodsOnly()
allowPublicMethodsOnly
in class AbstractFallbackCacheOperationSource
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |