Class CacheConfiguration
java.lang.Object
org.springframework.cache.annotation.CachingConfigurerSupport
es.kukenan.smartfi.microservice.contracts.cache.CacheConfiguration
- All Implemented Interfaces:
org.springframework.cache.annotation.CachingConfigurer
@Configuration
@EnableCaching
@RefreshScope
public class CacheConfiguration
extends org.springframework.cache.annotation.CachingConfigurerSupport
Class cache configuration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.springframework.cache.CacheManagerCache manager.private com.hazelcast.core.HazelcastInstanceHazelcastInstance hazelcastInstance.private Stringcache products established.private inttime-to-live established. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.cache.CacheManagerorg.springframework.cache.interceptor.CacheResolverorg.springframework.cache.interceptor.KeyGeneratorCreate bean internal products key generator.org.springframework.cache.interceptor.KeyGeneratorCreate bean movement key generator.org.springframework.cache.interceptor.KeyGeneratorCreate bean products key generator.Methods inherited from class org.springframework.cache.annotation.CachingConfigurerSupport
errorHandler, keyGenerator
-
Field Details
-
timeToLive
@Value("${cache.time-to-live}") private int timeToLivetime-to-live established. -
productsCacheName
cache products established. -
hazelcastInstance
@Autowired @Qualifier("hazelcastInstance") private com.hazelcast.core.HazelcastInstance hazelcastInstanceHazelcastInstance hazelcastInstance. -
cacheManager
private org.springframework.cache.CacheManager cacheManagerCache manager.
-
-
Constructor Details
-
CacheConfiguration
public CacheConfiguration()
-
-
Method Details
-
cacheManager
@Bean public org.springframework.cache.CacheManager cacheManager()- Specified by:
cacheManagerin interfaceorg.springframework.cache.annotation.CachingConfigurer- Overrides:
cacheManagerin classorg.springframework.cache.annotation.CachingConfigurerSupport
-
cacheResolver
@Bean public org.springframework.cache.interceptor.CacheResolver cacheResolver()- Specified by:
cacheResolverin interfaceorg.springframework.cache.annotation.CachingConfigurer- Overrides:
cacheResolverin classorg.springframework.cache.annotation.CachingConfigurerSupport
-
movementsKeyGenerator
@Bean("movementsKeyGenerator") public org.springframework.cache.interceptor.KeyGenerator movementsKeyGenerator()Create bean movement key generator.- Returns:
- bean of cache movement products.
-
productsKeyGenerator
@Bean("productsKeyGenerator") public org.springframework.cache.interceptor.KeyGenerator productsKeyGenerator()Create bean products key generator.- Returns:
- bean of cache products list.
-
internalProductsKeyGenerator
@Bean("internalProductsKeyGenerator") public org.springframework.cache.interceptor.KeyGenerator internalProductsKeyGenerator()Create bean internal products key generator.- Returns:
- bean of cache products list.
-