Top Description Constructors Methods
org.springframework.cache.annotation

public Class CachingConfigurerSupport

extends Object
implements CachingConfigurer
Class Inheritance
All Implemented Interfaces
org.springframework.cache.annotation.CachingConfigurer
Annotations
@Deprecated
since:6.0
Imports
org.springframework.cache.CacheManager, org.springframework.cache.interceptor.CacheErrorHandler, .CacheResolver, .KeyGenerator, org.springframework.lang.Nullable

Deprecated

since 6.0.

as of 6.0 in favor of implementing CachingConfigurer directly

An implementation of CachingConfigurer with empty methods allowing subclasses to override only the methods they're interested in.
Author
Stephane Nicoll
Since
4.1
See Also
CachingConfigurer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public CacheManager
cacheManager()

Overrides default org.springframework.cache.annotation.CachingConfigurer.cacheManager.

Return the cache manager bean to use for annotation-driven cache management.

public CacheResolver
cacheResolver()

Overrides default org.springframework.cache.annotation.CachingConfigurer.cacheResolver.

Return the CacheResolver bean to use to resolve regular caches for annotation-driven cache management.

public CacheErrorHandler
errorHandler()

Overrides default org.springframework.cache.annotation.CachingConfigurer.errorHandler.

Return the CacheErrorHandler to use to handle cache-related errors.

public KeyGenerator
keyGenerator()

Overrides default org.springframework.cache.annotation.CachingConfigurer.keyGenerator.

Return the key generator bean to use for annotation-driven cache management.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

CachingConfigurerSupportback to summary
public CachingConfigurerSupport()

Method Detail

cacheManagerback to summary
public CacheManager cacheManager()

Overrides default org.springframework.cache.annotation.CachingConfigurer.cacheManager.

Doc from org.springframework.cache.annotation.CachingConfigurer.cacheManager.

Return the cache manager bean to use for annotation-driven cache management. A default CacheResolver will be initialized behind the scenes with this cache manager. For more fine-grained management of the cache resolution, consider setting the CacheResolver directly.

Implementations must explicitly declare @Bean, e.g.

@Configuration
@EnableCaching
public class AppConfig implements CachingConfigurer {
    @Bean // important!
    @Override
    public CacheManager cacheManager() {
        // configure and return CacheManager instance
    }
    // ...
}
See @EnableCaching for more complete examples.
Annotations
@Override
@Nullable
cacheResolverback to summary
public CacheResolver cacheResolver()

Overrides default org.springframework.cache.annotation.CachingConfigurer.cacheResolver.

Doc from org.springframework.cache.annotation.CachingConfigurer.cacheResolver.

Return the CacheResolver bean to use to resolve regular caches for annotation-driven cache management. This is an alternative and more powerful option of specifying the CacheManager to use.

If both a cacheManager() and #cacheResolver() are set, the cache manager is ignored.

Implementations must explicitly declare @Bean, e.g.

@Configuration
@EnableCaching
public class AppConfig implements CachingConfigurer {
    @Bean // important!
    @Override
    public CacheResolver cacheResolver() {
        // configure and return CacheResolver instance
    }
    // ...
}
See EnableCaching for more complete examples.
Annotations
@Override
@Nullable
errorHandlerback to summary
public CacheErrorHandler errorHandler()

Overrides default org.springframework.cache.annotation.CachingConfigurer.errorHandler.

Doc from org.springframework.cache.annotation.CachingConfigurer.errorHandler.

Return the CacheErrorHandler to use to handle cache-related errors.

By default,org.springframework.cache.interceptor.SimpleCacheErrorHandler is used and simply throws the exception back at the client.

Implementations must explicitly declare @Bean, e.g.

@Configuration
@EnableCaching
public class AppConfig implements CachingConfigurer {
    @Bean // important!
    @Override
    public CacheErrorHandler errorHandler() {
        // configure and return CacheErrorHandler instance
    }
    // ...
}
See @EnableCaching for more complete examples.
Annotations
@Override
@Nullable
keyGeneratorback to summary
public KeyGenerator keyGenerator()

Overrides default org.springframework.cache.annotation.CachingConfigurer.keyGenerator.

Doc from org.springframework.cache.annotation.CachingConfigurer.keyGenerator.

Return the key generator bean to use for annotation-driven cache management. Implementations must explicitly declare @Bean, e.g.

@Configuration
@EnableCaching
public class AppConfig implements CachingConfigurer {
    @Bean // important!
    @Override
    public KeyGenerator keyGenerator() {
        // configure and return KeyGenerator instance
    }
    // ...
}
See @EnableCaching for more complete examples.
Annotations
@Override
@Nullable