public class RedisCacheService extends AbstractCacheService
LONG_CACHE_SECONDS, MEDIUM_CACHE_SECONDS, NULL, SHORT_CACHE_SECONDS| 构造器和说明 |
|---|
RedisCacheService() |
RedisCacheService(redis.clients.jedis.JedisPool jedisPool) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cache(String key,
int timeoutSeconds,
Object object)
只写
|
void |
delete(String key)
删除缓存
|
protected <T> T |
doCache(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.JedisPool |
getJedisPool() |
void |
setJedisPool(redis.clients.jedis.JedisPool jedisPool) |
cache, cache, cache, cache, cacheBean, cacheList, cacheLong, cacheLong, cacheLong, cacheMedium, cacheMedium, cacheMedium, cacheShort, cacheShort, cacheShort, isNotConvertStrToJson, setNotConvertStrToJson, toBean, toList, toStringpublic RedisCacheService()
public RedisCacheService(redis.clients.jedis.JedisPool jedisPool)
public void delete(String key)
CacheServicekey - 键public void cache(String key, int timeoutSeconds, Object object)
CacheServicekey - 键timeoutSeconds - 过期秒数object - 对象protected <T> T doCache(String key, int timeoutSeconds, Type resType, CacheGetter<T> getter)
AbstractCacheServicedoCache 在类中 AbstractCacheServiceT - 泛型key - 缓存键timeoutSeconds - 过期秒数resType - 返回类型getter - 获取器protected <T> List<T> doCacheList(String key, int timeoutSeconds, Class<T> resType, CacheGetter<List<T>> getter)
AbstractCacheServicedoCacheList 在类中 AbstractCacheServiceT - 泛型key - 缓存键timeoutSeconds - 过期秒数resType - 返回类型getter - 获取器public redis.clients.jedis.JedisPool getJedisPool()
public void setJedisPool(redis.clients.jedis.JedisPool jedisPool)
Copyright © 2024. All rights reserved.