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

    Fields
    Modifier and Type
    Field
    Description
    private org.springframework.cache.CacheManager
    Cache manager.
    private com.hazelcast.core.HazelcastInstance
    HazelcastInstance hazelcastInstance.
    private String
    cache products established.
    private int
    time-to-live established.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.cache.CacheManager
     
    org.springframework.cache.interceptor.CacheResolver
     
    org.springframework.cache.interceptor.KeyGenerator
    Create bean internal products key generator.
    org.springframework.cache.interceptor.KeyGenerator
    Create bean movement key generator.
    org.springframework.cache.interceptor.KeyGenerator
    Create bean products key generator.

    Methods inherited from class org.springframework.cache.annotation.CachingConfigurerSupport

    errorHandler, keyGenerator

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • timeToLive

      @Value("${cache.time-to-live}") private int timeToLive
      time-to-live established.
    • productsCacheName

      @Value("${cache.products}") private String productsCacheName
      cache products established.
    • hazelcastInstance

      @Autowired @Qualifier("hazelcastInstance") private com.hazelcast.core.HazelcastInstance hazelcastInstance
      HazelcastInstance hazelcastInstance.
    • cacheManager

      private org.springframework.cache.CacheManager cacheManager
      Cache manager.
  • Constructor Details

    • CacheConfiguration

      public CacheConfiguration()
  • Method Details

    • cacheManager

      @Bean public org.springframework.cache.CacheManager cacheManager()
      Specified by:
      cacheManager in interface org.springframework.cache.annotation.CachingConfigurer
      Overrides:
      cacheManager in class org.springframework.cache.annotation.CachingConfigurerSupport
    • cacheResolver

      @Bean public org.springframework.cache.interceptor.CacheResolver cacheResolver()
      Specified by:
      cacheResolver in interface org.springframework.cache.annotation.CachingConfigurer
      Overrides:
      cacheResolver in class org.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.