类 LettuceCacheProvider

java.lang.Object
io.lettuce.core.pubsub.RedisPubSubAdapter<String,String>
net.oschina.j2cache.lettuce.LettuceCacheProvider
所有已实现的接口:
io.lettuce.core.pubsub.RedisPubSubListener<String,String>, CacheProvider, ClusterPolicy

public class LettuceCacheProvider extends io.lettuce.core.pubsub.RedisPubSubAdapter<String,String> implements CacheProvider, ClusterPolicy
使用 Lettuce 进行 Redis 的操作 配置信息: lettuce.namespace = lettuce.storage = generic lettuce.scheme = redis|rediss|redis-sentinel lettuce.hosts = 127.0.0.1:6379 lettuce.password = lettuce.database = 0 lettuce.sentinelMasterId =
作者:
Winter Lau (javayou@gmail.com)
  • 构造器详细资料

    • LettuceCacheProvider

      public LettuceCacheProvider()
  • 方法详细资料

    • name

      public String name()
      从接口复制的说明: CacheProvider
      缓存的标识名称
      指定者:
      name 在接口中 CacheProvider
      返回:
      return cache provider name
    • level

      public int level()
      从接口复制的说明: CacheProvider
      缓存的层级
      指定者:
      level 在接口中 CacheProvider
      返回:
      current provider level
    • isLocalCommand

      public boolean isLocalCommand(Command cmd)
      从接口复制的说明: ClusterPolicy
      判断是否本地实例的命令
      指定者:
      isLocalCommand 在接口中 ClusterPolicy
      参数:
      cmd - 命令信息
      返回:
      true if the cmd sent by self
    • start

      public void start(Properties props)
      从接口复制的说明: CacheProvider
      Callback to perform any necessary initialization of the underlying cache implementation during SessionFactory construction.
      指定者:
      start 在接口中 CacheProvider
      参数:
      props - current configuration settings.
    • stop

      public void stop()
      从接口复制的说明: CacheProvider
      Callback to perform any necessary cleanup of the underlying cache implementation during SessionFactory.close().
      指定者:
      stop 在接口中 CacheProvider
    • buildCache

      public Cache buildCache(String region, CacheExpiredListener listener)
      从接口复制的说明: CacheProvider
      Configure the cache
      指定者:
      buildCache 在接口中 CacheProvider
      参数:
      region - the name of the cache region
      listener - listener for expired elements
      返回:
      return cache instance
    • buildCache

      public Cache buildCache(String region, long timeToLiveInSeconds, CacheExpiredListener listener)
      从接口复制的说明: CacheProvider
      Configure the cache with timeToLiveInMills
      指定者:
      buildCache 在接口中 CacheProvider
      参数:
      region - cache region name
      timeToLiveInSeconds - time to live in second
      listener - listener for expired elements
      返回:
      return cache instance
    • regions

      public Collection<CacheChannel.Region> regions()
      从接口复制的说明: CacheProvider
      Return all channels defined in first level cache
      指定者:
      regions 在接口中 CacheProvider
      返回:
      all regions name
    • evict

      public void evict(String region, String... keys)
      删除本地某个缓存条目
      指定者:
      evict 在接口中 ClusterPolicy
      参数:
      region - 区域名称
      keys - 缓存键值
    • clear

      public void clear(String region)
      清除本地整个缓存区域
      指定者:
      clear 在接口中 ClusterPolicy
      参数:
      region - 区域名称
    • connect

      public void connect(Properties props, CacheProviderHolder holder)
      从接口复制的说明: ClusterPolicy
      连接到集群
      指定者:
      connect 在接口中 ClusterPolicy
      参数:
      props - j2cache 配置信息
      holder - Cache Provider Instance
    • message

      public void message(String channel, String message)
      指定者:
      message 在接口中 io.lettuce.core.pubsub.RedisPubSubListener<String,String>
      覆盖:
      message 在类中 io.lettuce.core.pubsub.RedisPubSubAdapter<String,String>
    • publish

      public void publish(Command cmd)
      从接口复制的说明: ClusterPolicy
      发送消息
      指定者:
      publish 在接口中 ClusterPolicy
      参数:
      cmd - command to send
    • disconnect

      public void disconnect()
      从接口复制的说明: ClusterPolicy
      断开集群连接
      指定者:
      disconnect 在接口中 ClusterPolicy