Exemple #1
0
  private Node getNode(int id) {
    for (Node n : nodes) {
      if (id == n.getNodeId()) return n;
    }

    throw new RuntimeException("Node not found, id = " + id);
  }
Exemple #2
0
  public void addNode(Node node) {
    if (node == null) return;

    if (node instanceof BullyNode) {
      ((BullyNode) node).setTransport(transport);
      transport.addNode(node);
    } else {
      BullyWrapperNode b = new BullyWrapperNode(node);
      b.setTransport(transport);
      transport.addNode(b);
    }

    if (!node.isAlive()) node.start();
  }
Exemple #3
0
 @Override
 public void process(Message msg) {
   node.process(msg);
 }
Exemple #4
0
 @Override
 public void run() {
   node.run();
 }
Exemple #5
0
 public BullyWrapperNode(Node node) {
   super(node.getNodeId());
   this.node = node;
 }