类 RedisCacheService

java.lang.Object
cn.zhxu.toys.cache.AbstractCacheService
cn.zhxu.toys.cache.RedisCacheService
所有已实现的接口:
CacheService

public class RedisCacheService extends AbstractCacheService
CacheService Jedis 实现
  • 构造器详细资料

    • RedisCacheService

      public RedisCacheService()
    • RedisCacheService

      public RedisCacheService(redis.clients.jedis.JedisPool jedisPool)
  • 方法详细资料

    • delete

      public void delete(String key)
      从接口复制的说明: CacheService
      删除缓存
      参数:
      key - 键
    • cache

      public void cache(String key, int timeoutSeconds, Object object)
      从接口复制的说明: CacheService
      只写
      参数:
      key - 键
      timeoutSeconds - 过期秒数
      object - 对象
    • doCache

      protected <T> T doCache(String key, int timeoutSeconds, Type resType, CacheGetter<T> getter)
      从类复制的说明: 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)