类 RedisCacheService
java.lang.Object
cn.zhxu.toys.cache.AbstractCacheService
cn.zhxu.toys.cache.RedisCacheService
- 所有已实现的接口:
CacheService
CacheService Jedis 实现
-
字段概要
从接口继承的字段 cn.zhxu.toys.cache.CacheService
LONG_CACHE_SECONDS, MEDIUM_CACHE_SECONDS, NULL, SHORT_CACHE_SECONDS -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void只写void删除缓存protected <T> TdoCache(String key, int timeoutSeconds, Type resType, CacheGetter<T> getter) 先读,都读到则返回,否则若 getter 非空,则写protected <T> List<T>doCacheList(String key, int timeoutSeconds, Class<T> resType, CacheGetter<List<T>> getter) 先读,都读到则返回,否则若 getter 非空,则写redis.clients.jedis.JedisPoolvoidsetJedisPool(redis.clients.jedis.JedisPool jedisPool) 从类继承的方法 cn.zhxu.toys.cache.AbstractCacheService
cache, cache, cache, cache, cacheBean, cacheList, cacheLong, cacheLong, cacheLong, cacheMedium, cacheMedium, cacheMedium, cacheShort, cacheShort, cacheShort, isNotConvertStrToJson, setNotConvertStrToJson, toBean, toList, toString
-
构造器详细资料
-
RedisCacheService
public RedisCacheService() -
RedisCacheService
public RedisCacheService(redis.clients.jedis.JedisPool jedisPool)
-
-
方法详细资料
-
delete
从接口复制的说明:CacheService删除缓存- 参数:
key- 键
-
cache
从接口复制的说明:CacheService只写- 参数:
key- 键timeoutSeconds- 过期秒数object- 对象
-
doCache
从类复制的说明:AbstractCacheService先读,都读到则返回,否则若 getter 非空,则写- 指定者:
doCache在类中AbstractCacheService- 类型参数:
T- 泛型- 参数:
key- 缓存键timeoutSeconds- 过期秒数resType- 返回类型getter- 获取器- 返回:
- 缓存值
-
doCacheList
protected <T> List<T> doCacheList(String key, int timeoutSeconds, Class<T> resType, CacheGetter<List<T>> getter) 从类复制的说明:AbstractCacheService先读,都读到则返回,否则若 getter 非空,则写- 指定者:
doCacheList在类中AbstractCacheService- 类型参数:
T- 泛型- 参数:
key- 缓存键timeoutSeconds- 过期秒数resType- 返回类型getter- 获取器- 返回:
- 缓存值
-
getJedisPool
public redis.clients.jedis.JedisPool getJedisPool() -
setJedisPool
public void setJedisPool(redis.clients.jedis.JedisPool jedisPool)
-