org.springframework.cache.annotation

Class AnnotationCacheOperationSource

  • All Implemented Interfaces:
    java.io.Serializable, CacheOperationSource


    public class AnnotationCacheOperationSource
    extends AbstractFallbackCacheOperationSource
    implements java.io.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:
    Serialized Form
    • Constructor Detail

      • 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(java.util.Set<CacheAnnotationParser> annotationParsers)
        Create a custom AnnotationCacheOperationSource.
        Parameters:
        annotationParsers - the CacheAnnotationParser to use