Ejemplo n.º 1
0
 private void sendFail(boolean[] failed, Channel channel) {
   try {
     Fail ev = new Fail(failed, vs.group, vs.id);
     EchoEvent echo = new EchoEvent(ev, channel, Direction.DOWN, this);
     echo.go();
   } catch (AppiaEventException ex) {
     ex.printStackTrace();
     System.err.println("appia:group:SuspectSession: impossible to inform locally of failure");
   }
 }
Ejemplo n.º 2
0
  /** @param event */
  private void handleEchoEvent(EchoEvent echo) {
    if (echo.getEvent() instanceof BlockOk) {
      log.debug(
          "Replicating EchoEvent to all channels. Echo received on Channel: "
              + echo.getChannel().getChannelID());
      blockOkCounter = 0;

      BlockOk blockok = (BlockOk) echo.getEvent();

      Iterator<Channel> it = channels.keySet().iterator();
      for (; it.hasNext(); ) {
        Channel c = it.next();
        if (!c.equals(echo.getChannel())) {
          try {
            EchoEvent copy =
                new EchoEvent(new BlockOk(blockok.group, blockok.view_id), c, echo.getDir(), this);
            copy.go();
            blockOkCounter++;
          } catch (AppiaEventException e2) {
            e2.printStackTrace();
          }
        }
      }
      try {
        echo.go();
        blockOkCounter++;
      } catch (AppiaEventException e1) {
        e1.printStackTrace();
      }

    } else {
      try {
        echo.go();
      } catch (AppiaEventException e) {
        e.printStackTrace();
      }
    }
  }