Ejemplo n.º 1
0
    public int onEnd() {
      // The next reply (if any) will be a reply to the received message
      SSResponder parent = (SSResponder) getParent();
      parent.setMessageToReplyKey((String) receivedMsgKey);

      return super.onEnd();
    }
Ejemplo n.º 2
0
 public void action() {
   SSResponder parent = (SSResponder) getParent();
   ACLMessage received = (ACLMessage) getDataStore().get(parent.RECEIVED_KEY);
   if (received != null && parent.checkInSequence(received)) {
     ret = received.getPerformative();
   } else {
     ret = OUT_OF_SEQUENCE_EXIT_CODE;
   }
 }
Ejemplo n.º 3
0
    public int onEnd() {
      int ret = super.onEnd();
      SSResponder parent = (SSResponder) getParent();

      // If a reply was sent back, adjust the template and deadline of the
      // RECEIVE_NEXT state
      ACLMessage reply = (ACLMessage) getDataStore().get(parent.REPLY_KEY);
      if (reply != null) {
        MsgReceiver mr = (MsgReceiver) parent.getState(RECEIVE_NEXT);
        mr.setTemplate(createNextMsgTemplate(reply));

        Date d = reply.getReplyByDate();
        if (d != null && d.getTime() > System.currentTimeMillis()) {
          mr.setDeadline(d.getTime());
        } else {
          mr.setDeadline(MsgReceiver.INFINITE);
        }
      }

      parent.afterReply(reply);
      return ret;
    }
Ejemplo n.º 4
0
 public void action() {
   SSResponder parent = (SSResponder) getParent();
   parent.sessionTerminated();
 }
Ejemplo n.º 5
0
 public void onStart() {
   SSResponder parent = (SSResponder) getParent();
   ACLMessage reply = (ACLMessage) getDataStore().get(parent.REPLY_KEY);
   parent.beforeReply(reply);
 }
Ejemplo n.º 6
0
 public void action() {
   SSResponder parent = (SSResponder) getParent();
   parent.handleOutOfSequence((ACLMessage) getDataStore().get(parent.RECEIVED_KEY));
 }