示例#1
0
  public void messageIn(Message m) {
    if (m instanceof Reply) {
      if (m.getDest().equals(this.getSOID())) {
        WebSim.traceObjectOperation("Client", getName(), "Recieved reply " + m);

        in++;
        replies.add(((Reply) m).requestTimeToNow());
      } else {
        WebSim.warning(
            "There is probably a routing error in your system specification.\n"
                + "Client "
                + getName()
                + " has recieved a reply destined for  "
                + m.getDest()
                + "\n"
                + "It will be ignored.");

        faultyIn++;
      }
    } else if (m instanceof Refusal) {
      WebSim.traceObjectOperation("Client", getName(), "Recieved refusal " + m);
      refusals++;
    } else {
      WebSim.warning(
          "WARNING: There is probably a routing error in your system specification.\n"
              + "Client "
              + getName()
              + " has recieved the message  "
              + m
              + "\n"
              + "It will be ignored.");

      faultyIn++;
    }
  }