public class RedissonSpringCacheManager extends Object implements org.springframework.cache.CacheManager, org.springframework.context.ResourceLoaderAware, org.springframework.beans.factory.InitializingBean
CacheManager implementation
backed by Redisson instance.| Constructor and Description |
|---|
RedissonSpringCacheManager(RedissonClient redisson)
Creates CacheManager supplied by Redisson instance
|
RedissonSpringCacheManager(RedissonClient redisson,
Map<String,? extends CacheConfig> config)
Creates CacheManager supplied by Redisson instance and
Cache config mapped by Cache name
|
RedissonSpringCacheManager(RedissonClient redisson,
Map<String,? extends CacheConfig> config,
Codec codec)
Creates CacheManager supplied by Redisson instance, Codec instance
and Cache config mapped by Cache name.
|
RedissonSpringCacheManager(RedissonClient redisson,
String configLocation)
Creates CacheManager supplied by Redisson instance
and Cache config mapped by Cache name.
|
RedissonSpringCacheManager(RedissonClient redisson,
String configLocation,
Codec codec)
Creates CacheManager supplied by Redisson instance, Codec instance
and Config location path.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected CacheConfig |
createDefaultConfig() |
org.springframework.cache.Cache |
getCache(String name) |
Collection<String> |
getCacheNames() |
protected RMap<Object,Object> |
getMap(String name,
CacheConfig config) |
protected RMapCache<Object,Object> |
getMapCache(String name,
CacheConfig config) |
void |
setAllowNullValues(boolean allowNullValues)
Defines possibility of storing
null values. |
void |
setCacheNames(Collection<String> names)
Defines 'fixed' cache names.
|
void |
setCodec(Codec codec)
Set Codec instance shared between all Cache instances
|
void |
setConfig(Map<String,? extends CacheConfig> config)
Set cache config mapped by cache name
|
void |
setConfigLocation(String configLocation)
Set cache config location
|
void |
setRedisson(RedissonClient redisson)
Set Redisson instance
|
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
public RedissonSpringCacheManager(RedissonClient redisson)
redisson - objectpublic RedissonSpringCacheManager(RedissonClient redisson, Map<String,? extends CacheConfig> config)
redisson - objectconfig - objectpublic RedissonSpringCacheManager(RedissonClient redisson, Map<String,? extends CacheConfig> config, Codec codec)
Each Cache instance share one Codec instance.
redisson - objectconfig - objectcodec - objectpublic RedissonSpringCacheManager(RedissonClient redisson, String configLocation)
Loads the config file from the class path, interpreting plain paths as class path resource names that include the package path (e.g. "mypackage/myresource.txt").
redisson - objectconfigLocation - pathpublic RedissonSpringCacheManager(RedissonClient redisson, String configLocation, Codec codec)
Each Cache instance share one Codec instance.
Loads the config file from the class path, interpreting plain paths as class path resource names that include the package path (e.g. "mypackage/myresource.txt").
redisson - objectconfigLocation - pathcodec - objectpublic void setAllowNullValues(boolean allowNullValues)
null values.
Default is true
allowNullValues - - stores if truepublic void setCacheNames(Collection<String> names)
`null` parameter setups dynamic mode
names - of cachespublic void setConfigLocation(String configLocation)
configLocation - objectpublic void setConfig(Map<String,? extends CacheConfig> config)
config - objectpublic void setRedisson(RedissonClient redisson)
redisson - instancepublic void setCodec(Codec codec)
codec - objectprotected CacheConfig createDefaultConfig()
public org.springframework.cache.Cache getCache(String name)
getCache in interface org.springframework.cache.CacheManagerprotected RMap<Object,Object> getMap(String name, CacheConfig config)
protected RMapCache<Object,Object> getMapCache(String name, CacheConfig config)
public Collection<String> getCacheNames()
getCacheNames in interface org.springframework.cache.CacheManagerpublic void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader in interface org.springframework.context.ResourceLoaderAwareCopyright © 2014–2018 The Redisson Project. All rights reserved.