Java 类io.vertx.core.spi.cluster.NodeListener 实例源码

项目:atomix-vertx    文件:AtomixClusterManager.java   
/**
 * Handles a cluster event.
 */
private void handleClusterEvent(ClusterEvent event) {
  NodeListener nodeListener = this.listener;
  if (nodeListener != null) {
    context.execute(() -> {
      if (active.get()) {
        switch (event.type()) {
          case NODE_ACTIVATED:
            nodeListener.nodeAdded(event.subject().id().id());
            break;
          case NODE_DEACTIVATED:
            nodeListener.nodeLeft(event.subject().id().id());
            break;
          default:
            break;
        }
      }
    });
  }
}
项目:vertx-zero    文件:FakeClusterManager.java   
@Override
public void nodeListener(final NodeListener listener) {
    this.nodeListener = listener;
}
项目:vert.3x-gateway    文件:ZookeeperClusterManager.java   
@Override
public void nodeListener(NodeListener listener) {
  this.nodeListener = listener;
}
项目:vertx-jgroups    文件:JGroupsClusterManager.java   
@Override
public void nodeListener(NodeListener listener) {
  logTrace(() -> String.format("Set nodeListener [%s] on address [%s]", listener, address));
  topologyListener.setNodeListener(listener);
}
项目:vertx-jgroups    文件:TopologyListener.java   
public void setNodeListener(NodeListener nodeListener) {
  logDebug(() -> String.format("Set topology listener [%s]", nodeListener));
  this.nodeListener = Optional.of(nodeListener);
}
项目:vertx-hazelcast    文件:HazelcastClusterManager.java   
@Override
public void nodeListener(NodeListener listener) {
  this.nodeListener = listener;
}