com.hazelcast.spring.cache

## 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

  Sprint related `HazelcastCacheManager` implementation for Hazelcast.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CACHE_PROP` Property name for hazelcast spring-cache related properties.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HazelcastCacheManager()`
    `HazelcastCacheManager(HazelcastInstance hazelcastInstance)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.springframework.cache.Cache` | `getCache(String name)`
    `Collection<String>` | `getCacheNames()`
    `long` | `getDefaultReadTimeout()` Return default cache value retrieval timeout in milliseconds.
    `HazelcastInstance` | `getHazelcastInstance()`
    `Map<String,Long>` | `getReadTimeoutMap()` Return cache-specific value retrieval timeouts.
    `void` | `setCacheOptions(String options)` Set the cache ead-timeout params
    `void` | `setDefaultReadTimeout(long defaultReadTimeout)` Set default cache value retrieval timeout.
    `void` | `setHazelcastInstance(HazelcastInstance hazelcastInstance)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### CACHE_PROP

          public static final 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(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(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

Copyright © 2019. All rights reserved.