类 JGroupsClusterPolicy

java.lang.Object
org.jgroups.ReceiverAdapter
net.oschina.j2cache.cluster.JGroupsClusterPolicy
所有已实现的接口:
ClusterPolicy, org.jgroups.MembershipListener, org.jgroups.MessageListener, org.jgroups.Receiver

public class JGroupsClusterPolicy extends org.jgroups.ReceiverAdapter implements ClusterPolicy
使用 JGroups 组播进行集群内节点通讯
作者:
Winter Lau(javayou@gmail.com)
  • 构造器详细资料

    • JGroupsClusterPolicy

      public JGroupsClusterPolicy(String name, Properties props)
      构造函数
      参数:
      name - 组播频道名称
      props - 配置文件路径
  • 方法详细资料

    • isLocalCommand

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

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

      public void receive(org.jgroups.Message msg)
      指定者:
      receive 在接口中 org.jgroups.MessageListener
      覆盖:
      receive 在类中 org.jgroups.ReceiverAdapter
    • viewAccepted

      public void viewAccepted(org.jgroups.View view)
      指定者:
      viewAccepted 在接口中 org.jgroups.MembershipListener
      覆盖:
      viewAccepted 在类中 org.jgroups.ReceiverAdapter
    • publish

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