Class AnnotationCacheOperationSource

java.lang.Object
org.springframework.cache.interceptor.AbstractFallbackCacheOperationSource
org.springframework.cache.annotation.AnnotationCacheOperationSource
All Implemented Interfaces:
Serializable, CacheOperationSource

public class AnnotationCacheOperationSource extends AbstractFallbackCacheOperationSource implements Serializable
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.

Since:
3.1
Author:
Costin Leau, Juergen Hoeller, Stephane Nicoll
See Also:
  • Constructor Details

    • AnnotationCacheOperationSource

      public AnnotationCacheOperationSource()
      Create a default AnnotationCacheOperationSource, supporting public methods that carry the Cacheable and CacheEvict annotations.
    • AnnotationCacheOperationSource

      public AnnotationCacheOperationSource(boolean publicMethodsOnly)
      Create a default AnnotationCacheOperationSource, supporting public methods that carry the Cacheable and CacheEvict annotations.
      Parameters:
      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)
    • AnnotationCacheOperationSource

      public AnnotationCacheOperationSource(CacheAnnotationParser annotationParser)
      Create a custom AnnotationCacheOperationSource.
      Parameters:
      annotationParser - the CacheAnnotationParser to use
    • AnnotationCacheOperationSource

      public AnnotationCacheOperationSource(CacheAnnotationParser... annotationParsers)
      Create a custom AnnotationCacheOperationSource.
      Parameters:
      annotationParsers - the CacheAnnotationParser to use
    • AnnotationCacheOperationSource

      public AnnotationCacheOperationSource(Set<CacheAnnotationParser> annotationParsers)
      Create a custom AnnotationCacheOperationSource.
      Parameters:
      annotationParsers - the CacheAnnotationParser to use
  • Method Details