Configuration classes annotated with @EnableCaching that wish or need to specify
explicitly how caches are resolved and how keys are generated for annotation-driven
cache management.
See @EnableCaching for general examples and context; see
cacheManager(), cacheResolver() and keyGenerator()
for detailed instructions.
EnableCaching
| Modifier and Type | Method and Description |
|---|---|
| public default CacheManager | |
| public default CacheResolver | cacheResolver()
Return the |
| public default CacheErrorHandler | |
| public default KeyGenerator |
| cacheManager | back to summary |
|---|---|
| public default CacheManager cacheManager() Return the cache manager bean to use for annotation-driven cache
management. A default Implementations must explicitly declare
@Configuration
@EnableCaching
public class AppConfig implements CachingConfigurer {
@Bean // important!
@Override
public CacheManager cacheManager() {
// configure and return CacheManager instance
}
// ...
}
See @EnableCaching for more complete examples.
| |
| cacheResolver | back to summary |
|---|---|
| public default CacheResolver cacheResolver() Return the If both a Implementations must explicitly declare
@Configuration
@EnableCaching
public class AppConfig implements CachingConfigurer {
@Bean // important!
@Override
public CacheResolver cacheResolver() {
// configure and return CacheResolver instance
}
// ...
}
See EnableCaching for more complete examples.
| |
| errorHandler | back to summary |
|---|---|
| public default CacheErrorHandler errorHandler() Return the By default, Implementations must explicitly declare
@Configuration
@EnableCaching
public class AppConfig implements CachingConfigurer {
@Bean // important!
@Override
public CacheErrorHandler errorHandler() {
// configure and return CacheErrorHandler instance
}
// ...
}
See @EnableCaching for more complete examples.
| |
| keyGenerator | back to summary |
|---|---|
| public default KeyGenerator keyGenerator() Return the key generator bean to use for annotation-driven cache management.
Implementations must explicitly declare
@Configuration
@EnableCaching
public class AppConfig implements CachingConfigurer {
@Bean // important!
@Override
public KeyGenerator keyGenerator() {
// configure and return KeyGenerator instance
}
// ...
}
See @EnableCaching for more complete examples.
| |