public class RedisCacheService 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.noear.redisx.RedisClient |
client |
构造器和说明 |
---|
RedisCacheService(java.util.Properties prop) |
RedisCacheService(java.util.Properties prop,
java.lang.String keyHeader,
int defSeconds) |
RedisCacheService(org.noear.redisx.RedisClient client,
int defSeconds) |
RedisCacheService(org.noear.redisx.RedisClient client,
java.lang.String keyHeader,
int defSeconds) |
限定符和类型 | 方法和说明 |
---|---|
org.noear.redisx.RedisClient |
client()
获取 RedisClient
|
RedisCacheService |
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)
移除
|
RedisCacheService |
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.noear.redisx.RedisClient client
public RedisCacheService(org.noear.redisx.RedisClient client, int defSeconds)
public RedisCacheService(org.noear.redisx.RedisClient client, java.lang.String keyHeader, int defSeconds)
public RedisCacheService(java.util.Properties prop)
public RedisCacheService(java.util.Properties prop, java.lang.String keyHeader, int defSeconds)
public RedisCacheService enableMd5key(boolean enable)
public RedisCacheService serializer(Serializer<java.lang.String> serializer)
public org.noear.redisx.RedisClient 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)