コード例 #1
0
ファイル: NettyCommunicator.java プロジェクト: jhorey/Paja
  /**
   * Send a message to a non-specific node with the specified role. Usually this means sending to a
   * local role on the same node, unless the sending role is already on the node.
   */
  public void send(PaxosRole sender, PaxosRole.Role role, PaxosMessage msg) {
    // Ask the network for the "desired" target. Depending on the
    // network implementation, this could be the "leader", etc.
    StaticNetwork.Route route = network.getDesirable(home);

    if (route != null) {
      msg.setDestination(role);
      pipeline.startClient(route.ip, route.port, msg);
    }
  }