Пример #1
0
  protected void handleInform(ACLMessage msg) {
    try {
      notYetReady = false;
      lastMsg = (ACLMessage) msg.clone();
      if (this.action.equalsIgnoreCase(DFAppletVocabulary.FEDERATE)) {
        gui.showStatusMsg("Request processed. Ready for new  request.");
        gui.addParent(this.parent);
      } else if (this.action.equalsIgnoreCase(DFAppletVocabulary.GETDESCRIPTION)) {
        // UPDATE the thisDf variable.
        try {
          List result = getResult();
          dfApplet.setDescription((DFAgentDescription) result.get(0));
        } catch (NotYetReady nyr) {
          // FIXME: what should happen in this case ?
          nyr.printStackTrace();
        }
      } else if (this.action.equalsIgnoreCase(DFAppletVocabulary.GETPARENTS))
        gui.showStatusMsg("Request processed. Ready for new Request.");
      else if (this.action.equalsIgnoreCase(DFAppletVocabulary.DEREGISTERFROM)) {
        gui.showStatusMsg("Request processed. Ready for a new request");
        gui.removeParent(this.parent);
      } else if (this.action.equalsIgnoreCase(DFAppletVocabulary.REGISTERWITH))
        gui.showStatusMsg("Request processed. Ready for new request.");
      else if (this.action.equalsIgnoreCase(DFAppletVocabulary.SEARCHON)) {
        gui.refreshLastSearchResults(getResult(), (AID) parent);
        gui.showStatusMsg("Request processed. Ready for new request.");
      } else if (this.action.equalsIgnoreCase(DFAppletVocabulary.MODIFYON))
        gui.showStatusMsg("Request processed. Ready for new request.");

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Пример #2
0
 protected void handleAgree(ACLMessage msg) {
   try {
     lastMsg = (ACLMessage) msg.clone();
     gui.showStatusMsg("Process your request & waiting for result...");
   } catch (Exception e) {
   }
 }
Пример #3
0
 protected void handleFailure(ACLMessage msg) {
   try {
     notYetReady = false;
     lastMsg = (ACLMessage) msg.clone();
     gui.showStatusMsg("Request refused.");
     // FIXME: if no default description returned what should happen ?
   } catch (Exception e) {
     e.printStackTrace();
   }
 }