接口 ClusterPolicy
- 所有已知实现类:
JGroupsClusterPolicy,LettuceCacheProvider,NoneClusterPolicy,RabbitMQClusterPolicy,RedisPubSubClusterPolicy,RocketMQClusterPolicy
public interface ClusterPolicy
缓存集群策略接口
- 作者:
- Winter Lau(javayou@gmail.com)
-
字段概要
字段 -
方法概要
修饰符和类型方法说明void清除本地整个缓存区域voidconnect(Properties props, CacheProviderHolder holder) 连接到集群void断开集群连接void删除本地某个缓存条目default voidhandleCommand(Command cmd) 处理缓存事件逻辑booleanisLocalCommand(Command cmd) 判断是否本地实例的命令void发送消息default voidsendClearCmd(String region) 发送清除整个缓存区域的命令default voidsendEvictCmd(String region, String... keys) 发送清除缓存的命令
-
字段详细资料
-
log
static final org.slf4j.Logger log
-
-
方法详细资料
-
connect
连接到集群- 参数:
props- j2cache 配置信息holder- Cache Provider Instance
-
publish
发送消息- 参数:
cmd- command to send
-
sendEvictCmd
发送清除缓存的命令- 参数:
region- 区域名称keys- 缓存键值
-
sendClearCmd
发送清除整个缓存区域的命令- 参数:
region- 区域名称
-
disconnect
void disconnect()断开集群连接 -
evict
删除本地某个缓存条目- 参数:
region- 区域名称keys- 缓存键值
-
clear
清除本地整个缓存区域- 参数:
region- 区域名称
-
isLocalCommand
判断是否本地实例的命令- 参数:
cmd- 命令信息- 返回:
- true if the cmd sent by self
-
handleCommand
处理缓存事件逻辑- 参数:
cmd- the received command
-