Package 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 java.lang.Object implements org.springframework.cache.CacheManager
Spring-relatedCacheManager
implementation for Hazelcast.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CACHE_PROP
Property name for hazelcast spring-cache related properties.
-
Constructor Summary
Constructors Constructor Description HazelcastCacheManager()
HazelcastCacheManager(HazelcastInstance hazelcastInstance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.cache.Cache
getCache(java.lang.String name)
java.util.Collection<java.lang.String>
getCacheNames()
long
getDefaultReadTimeout()
Return default cache value retrieval timeout in milliseconds.HazelcastInstance
getHazelcastInstance()
java.util.Map<java.lang.String,java.lang.Long>
getReadTimeoutMap()
Return cache-specific value retrieval timeouts.void
setCacheOptions(java.lang.String options)
Set the cache ead-timeout paramsvoid
setDefaultReadTimeout(long defaultReadTimeout)
Set default cache value retrieval timeout.void
setHazelcastInstance(HazelcastInstance hazelcastInstance)
-
-
-
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 interfaceorg.springframework.cache.CacheManager
-
getCacheNames
public java.util.Collection<java.lang.String> getCacheNames()
- Specified by:
getCacheNames
in interfaceorg.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 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
-
-