public class RedissonCacheService extends java.lang.Object implements CacheService
限定符和类型 | 字段和说明 |
---|---|
protected java.lang.String |
_cacheKeyHead |
protected int |
_defaultSeconds |
protected boolean |
_enableMd5key |
protected Serializer<java.lang.String> |
_serializer |
protected org.redisson.api.RedissonClient |
client |
构造器和说明 |
---|
RedissonCacheService(java.util.Properties prop) |
RedissonCacheService(java.util.Properties prop,
java.lang.String keyHeader,
int defSeconds) |
RedissonCacheService(org.redisson.api.RedissonClient client,
int defSeconds) |
RedissonCacheService(org.redisson.api.RedissonClient client,
java.lang.String keyHeader,
int defSeconds) |
限定符和类型 | 方法和说明 |
---|---|
org.redisson.api.RedissonClient |
client()
获取 RedisClient
|
RedissonCacheService |
enableMd5key(boolean enable)
启用 Md5 key(默认为 true)
|
<T> T |
get(java.lang.String key,
java.lang.reflect.Type type)
获取
|
protected java.lang.String |
newKey(java.lang.String key) |
void |
remove(java.lang.String key)
移除
|
RedissonCacheService |
serializer(Serializer<java.lang.String> serializer)
配置序列化
|
void |
store(java.lang.String key,
java.lang.Object obj,
int seconds)
保存
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, getOrStore
protected java.lang.String _cacheKeyHead
protected int _defaultSeconds
protected Serializer<java.lang.String> _serializer
protected boolean _enableMd5key
protected final org.redisson.api.RedissonClient client
public RedissonCacheService(org.redisson.api.RedissonClient client, int defSeconds)
public RedissonCacheService(org.redisson.api.RedissonClient client, java.lang.String keyHeader, int defSeconds)
public RedissonCacheService(java.util.Properties prop)
public RedissonCacheService(java.util.Properties prop, java.lang.String keyHeader, int defSeconds)
public RedissonCacheService enableMd5key(boolean enable)
public RedissonCacheService serializer(Serializer<java.lang.String> serializer)
public org.redisson.api.RedissonClient client()
public void store(java.lang.String key, java.lang.Object obj, int seconds)
CacheService
store
在接口中 CacheService
key
- 缓存键obj
- 对象seconds
- 秒数public <T> T get(java.lang.String key, java.lang.reflect.Type type)
CacheService
get
在接口中 CacheService
key
- 缓存键public void remove(java.lang.String key)
CacheService
remove
在接口中 CacheService
key
- 缓存键protected java.lang.String newKey(java.lang.String key)