public class JGroupsClusterPolicy extends org.jgroups.ReceiverAdapter implements ClusterPolicy
Constructor and Description |
---|
JGroupsClusterPolicy(String name,
Properties props)
构造函数
|
Modifier and Type | Method and Description |
---|---|
void |
clear(String region)
清除本地整个缓存区域
|
void |
connect(Properties props,
CacheProviderHolder holder)
连接到集群
|
void |
disconnect()
断开集群连接
|
void |
evict(String region,
String... keys)
删除本地某个缓存条目
|
boolean |
isLocalCommand(Command cmd)
判断是否本地实例的命令
|
void |
publish(Command cmd)
发送消息
|
void |
receive(org.jgroups.Message msg) |
void |
viewAccepted(org.jgroups.View view) |
block, getState, setState, suspect, unblock
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleCommand, sendClearCmd, sendEvictCmd
public JGroupsClusterPolicy(String name, Properties props)
name
- 组播频道名称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)
ClusterPolicy
connect
in interface ClusterPolicy
props
- j2cache 配置信息holder
- Cache Provider Instancepublic void disconnect()
ClusterPolicy
disconnect
in interface ClusterPolicy
public void receive(org.jgroups.Message msg)
receive
in interface org.jgroups.MessageListener
receive
in class org.jgroups.ReceiverAdapter
public void viewAccepted(org.jgroups.View view)
viewAccepted
in interface org.jgroups.MembershipListener
viewAccepted
in class org.jgroups.ReceiverAdapter
public void publish(Command cmd)
ClusterPolicy
publish
in interface ClusterPolicy
cmd
- command to sendCopyright © 2018. All rights reserved.