public interface CachingConfigurer
Configuration classes annotated with @EnableCaching that wish or need to
specify explicitly the CacheManager and KeyGenerator beans to be used
for annotation-driven cache management.
See @EnableCaching for general examples and context; see
cacheManager() and keyGenerator() for detailed instructions.
EnableCaching| Modifier and Type | Method and Description |
|---|---|
CacheManager |
cacheManager()
Return the cache manager bean to use for annotation-driven cache management.
|
KeyGenerator |
keyGenerator()
Return the key generator bean to use for annotation-driven cache management.
|
CacheManager cacheManager()
@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.KeyGenerator keyGenerator()
@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.