Class HazelcastCacheManager

  • All Implemented Interfaces:
    org.springframework.cache.CacheManager

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

      • CACHE_PROP

        public static final java.lang.String CACHE_PROP
        Property name for hazelcast spring-cache related properties.
        See Also:
        Constant Field Values
    • Constructor Detail

      • HazelcastCacheManager

        public HazelcastCacheManager()
      • HazelcastCacheManager

        public HazelcastCacheManager​(HazelcastInstance hazelcastInstance)
    • Method Detail

      • getCache

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

        public java.util.Collection<java.lang.String> getCacheNames()
        Specified by:
        getCacheNames in interface org.springframework.cache.CacheManager
      • 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 java.util.Map<java.lang.String,​java.lang.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:}")
                                    java.lang.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