public class RedisCache<K,V> extends Object implements org.apache.shiro.cache.Cache<K,V>, Serializable
缓存接口实现类
Description:实现Shiro缓存接口,提供远程获取缓存对象、远程保存缓存对象和远程清空缓存库等功能
| 限定符和类型 | 字段和说明 |
|---|---|
protected RedisCachePool |
cachePool
The wrapped RedisCachePool instance.
|
| 构造器和说明 |
|---|
RedisCache(RedisCachePool cachePool)
Constructs a new RedisCache instance with the given CachePool.
|
RedisCache(RedisCachePool cachePool,
String name)
Constructs a new RedisCache instance with the given CachePool and name.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
static void |
close(redis.clients.jedis.Jedis jedis)
Close Jedis instance.
|
V |
get(K key) |
String |
getName() |
String |
getShiroCacheKeyPrefix() |
static redis.clients.jedis.Jedis |
initJedis(RedisCachePool cachePool)
Constructs a Jedis instance.
|
Set<K> |
keys() |
V |
put(K key,
V value) |
V |
remove(K key) |
void |
setName(String name) |
void |
setShiroCacheKeyPrefix(String shiroCacheKeyPrefix) |
int |
size() |
String |
toString() |
Collection<V> |
values() |
protected RedisCachePool cachePool
public RedisCache(RedisCachePool cachePool)
public RedisCache(RedisCachePool cachePool, String name)
public void clear()
throws org.apache.shiro.cache.CacheException
public Collection<V> values()
public static redis.clients.jedis.Jedis initJedis(RedisCachePool cachePool)
public static void close(redis.clients.jedis.Jedis jedis)
public String getName()
public void setName(String name)
public String getShiroCacheKeyPrefix()
public void setShiroCacheKeyPrefix(String shiroCacheKeyPrefix)
Copyright © 2016. All rights reserved.