public class RedisClient
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
static int |
DEFAULT_EXPIRY_IN_SECONDS |
private redis.clients.jedis.JedisPool |
jedisPool |
protected org.apache.commons.logging.Log |
log |
private java.util.Map<java.lang.String,RedisCacheEntity<java.lang.Object,java.lang.Object>> |
regionMap |
构造器和说明 |
---|
RedisClient(redis.clients.jedis.JedisPool jedisPool) |
限定符和类型 | 方法和说明 |
---|---|
void |
clearRegion(java.lang.String region) |
RedisCacheEntity<java.lang.Object,java.lang.Object> |
createOrGetCache(java.lang.String region) |
long |
dbSize() |
java.lang.Object |
del(java.lang.String region,
java.lang.Object key) |
boolean |
exists(java.lang.String region,
java.lang.Object key) |
void |
flushDb() |
<T> T |
get(java.lang.String region,
java.lang.Object key) |
boolean |
isShutdown() |
void |
removeRegion(java.lang.String region) |
void |
set(java.lang.String region,
java.lang.Object key,
java.lang.Object value) |
void |
set(java.lang.String region,
java.lang.Object key,
java.lang.Object value,
java.lang.Long expiry) |
void |
shutdown() |
public static final int DEFAULT_EXPIRY_IN_SECONDS
protected final org.apache.commons.logging.Log log
private redis.clients.jedis.JedisPool jedisPool
private java.util.Map<java.lang.String,RedisCacheEntity<java.lang.Object,java.lang.Object>> regionMap
public long dbSize()
public boolean exists(java.lang.String region, java.lang.Object key)
region
- key
- public <T> T get(java.lang.String region, java.lang.Object key)
region
- key
- public void set(java.lang.String region, java.lang.Object key, java.lang.Object value)
region
- key
- value
- public void set(java.lang.String region, java.lang.Object key, java.lang.Object value, java.lang.Long expiry)
region
- key
- value
- expiry
- public java.lang.Object del(java.lang.String region, java.lang.Object key)
region
- key
- public void clearRegion(java.lang.String region)
region
- public void removeRegion(java.lang.String region)
region
- public void flushDb()
public RedisCacheEntity<java.lang.Object,java.lang.Object> createOrGetCache(java.lang.String region)
region
- public boolean isShutdown()
public void shutdown()