public class RedisPubSubClusterPolicy extends redis.clients.jedis.JedisPubSub implements ClusterPolicy
Constructor and Description |
---|
RedisPubSubClusterPolicy(String channel,
Properties props) |
Modifier and Type | Method and Description |
---|---|
void |
clear(String region)
清除本地整个缓存区域
|
void |
connect(Properties props,
CacheProviderHolder holder)
加入 Redis 的发布订阅频道
|
void |
disconnect()
退出 Redis 发布订阅频道
|
void |
evict(String region,
String... keys)
删除本地某个缓存条目
|
boolean |
isLocalCommand(Command cmd)
判断是否本地实例的命令
|
void |
onMessage(String channel,
String message)
当接收到订阅频道获得的消息时触发此方法
|
void |
publish(Command cmd)
发送消息
|
getSubscribedChannels, isSubscribed, onPMessage, onPong, onPSubscribe, onPUnsubscribe, onSubscribe, onUnsubscribe, ping, proceed, proceedWithPatterns, psubscribe, punsubscribe, punsubscribe, subscribe, unsubscribe, unsubscribe
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleCommand, sendClearCmd, sendEvictCmd
public RedisPubSubClusterPolicy(String channel, Properties props)
public boolean isLocalCommand(Command cmd)
ClusterPolicy
isLocalCommand
in interface ClusterPolicy
cmd
- 命令信息public void evict(String region, String... keys)
evict
in interface ClusterPolicy
region
- 区域名称keys
- 缓存键值public void clear(String region)
clear
in interface ClusterPolicy
region
- 区域名称public void connect(Properties props, CacheProviderHolder holder)
connect
in interface ClusterPolicy
props
- j2cache 配置信息holder
- Cache Provider Instancepublic void disconnect()
disconnect
in interface ClusterPolicy
public void publish(Command cmd)
ClusterPolicy
publish
in interface ClusterPolicy
cmd
- command to sendCopyright © 2018. All rights reserved.