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,CacheConfig> config)
Creates CacheManager supplied by Redisson instance and
Cache config mapped by Cache name
|
RedissonSpringCacheManager(RedissonClient redisson,
Map<String,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() |
org.springframework.cache.Cache |
getCache(String name) |
Collection<String> |
getCacheNames() |
void |
setCodec(Codec codec)
Set Codec instance shared between all Cache instances
|
void |
setConfig(Map<String,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,CacheConfig> config)
redisson
- objectconfig
- objectpublic RedissonSpringCacheManager(RedissonClient redisson, Map<String,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 setConfigLocation(String configLocation)
configLocation
- objectpublic void setConfig(Map<String,CacheConfig> config)
config
- objectpublic void setRedisson(RedissonClient redisson)
redisson
- instancepublic void setCodec(Codec codec)
codec
- objectpublic org.springframework.cache.Cache getCache(String name)
getCache
in interface org.springframework.cache.CacheManager
public Collection<String> getCacheNames()
getCacheNames
in interface org.springframework.cache.CacheManager
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader
in interface org.springframework.context.ResourceLoaderAware
Copyright © 2014–2017 The Redisson Project. All rights reserved.