org.crazycake.shiro
类 RedisCache<K,V>

java.lang.Object
  继承者 org.crazycake.shiro.RedisCache<K,V>
所有已实现的接口:
org.apache.shiro.cache.Cache<K,V>

public class RedisCache<K,V>
extends Object
implements org.apache.shiro.cache.Cache<K,V>


构造方法摘要
RedisCache(RedisManager cache)
          通过一个JedisManager实例构造RedisCache
RedisCache(RedisManager cache, String prefix)
          Constructs a cache instance with the specified Redis manager and using a custom key prefix.
 
方法摘要
 void clear()
           
 V get(K key)
           
 String getKeyPrefix()
          Returns the Redis session keys prefix.
 Set<K> keys()
           
 V put(K key, V value)
           
 V remove(K key)
           
 void setKeyPrefix(String keyPrefix)
          Sets the Redis sessions key prefix.
 int size()
           
 Collection<V> values()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

RedisCache

public RedisCache(RedisManager cache)
通过一个JedisManager实例构造RedisCache


RedisCache

public RedisCache(RedisManager cache,
                  String prefix)
Constructs a cache instance with the specified Redis manager and using a custom key prefix.

参数:
cache - The cache manager instance
prefix - The Redis key prefix
方法详细信息

getKeyPrefix

public String getKeyPrefix()
Returns the Redis session keys prefix.

返回:
The prefix

setKeyPrefix

public void setKeyPrefix(String keyPrefix)
Sets the Redis sessions key prefix.

参数:
keyPrefix - The prefix

get

public V get(K key)
      throws org.apache.shiro.cache.CacheException
指定者:
接口 org.apache.shiro.cache.Cache<K,V> 中的 get
抛出:
org.apache.shiro.cache.CacheException

put

public V put(K key,
             V value)
      throws org.apache.shiro.cache.CacheException
指定者:
接口 org.apache.shiro.cache.Cache<K,V> 中的 put
抛出:
org.apache.shiro.cache.CacheException

remove

public V remove(K key)
         throws org.apache.shiro.cache.CacheException
指定者:
接口 org.apache.shiro.cache.Cache<K,V> 中的 remove
抛出:
org.apache.shiro.cache.CacheException

clear

public void clear()
           throws org.apache.shiro.cache.CacheException
指定者:
接口 org.apache.shiro.cache.Cache<K,V> 中的 clear
抛出:
org.apache.shiro.cache.CacheException

size

public int size()
指定者:
接口 org.apache.shiro.cache.Cache<K,V> 中的 size

keys

public Set<K> keys()
指定者:
接口 org.apache.shiro.cache.Cache<K,V> 中的 keys

values

public Collection<V> values()
指定者:
接口 org.apache.shiro.cache.Cache<K,V> 中的 values


Copyright © 2014. All rights reserved.