Class HazelcastCacheManager

java.lang.Object
com.hazelcast.spring.cache.HazelcastCacheManager
All Implemented Interfaces:
org.springframework.cache.CacheManager

public class HazelcastCacheManager extends Object implements org.springframework.cache.CacheManager
Spring-related CacheManager implementation for Hazelcast.
  • Field Details

    • CACHE_PROP

      public static final String CACHE_PROP
      Property name for hazelcast spring-cache related properties.
      See Also:
  • Constructor Details

    • HazelcastCacheManager

      public HazelcastCacheManager()
    • HazelcastCacheManager

      public HazelcastCacheManager(HazelcastInstance hazelcastInstance)
  • Method Details

    • getCache

      public org.springframework.cache.Cache getCache(String name)
      Specified by:
      getCache in interface org.springframework.cache.CacheManager
    • getCacheNames

      public Collection<String> getCacheNames()
      Specified by:
      getCacheNames in interface org.springframework.cache.CacheManager
    • getHazelcastInstance

      public HazelcastInstance getHazelcastInstance()
    • setHazelcastInstance

      public void setHazelcastInstance(HazelcastInstance hazelcastInstance)
    • getDefaultReadTimeout

      public long getDefaultReadTimeout()
      Return default cache value retrieval timeout in milliseconds.
    • setDefaultReadTimeout

      public void setDefaultReadTimeout(long defaultReadTimeout)
      Set default cache value retrieval timeout. Applies to all caches, if not defined a cache specific timeout.
      Parameters:
      defaultReadTimeout - default cache retrieval timeout in milliseconds. 0 or negative values disable timeout.
    • getReadTimeoutMap

      public Map<String,Long> getReadTimeoutMap()
      Return cache-specific value retrieval timeouts. Map keys are cache names, values are cache retrieval timeouts in milliseconds.
    • setCacheOptions

      @Autowired public void setCacheOptions(@Value("${hazelcast.spring.cache.prop:}") String options)
      Set the cache ead-timeout params
      Parameters:
      options - cache read-timeout params, auto-wired by Spring automatically by getting value of hazelcast.spring.cache.prop parameter