Package jade.lang.acl

Examples of jade.lang.acl.ACLMessage


        throw new NotUnderstoodException(errorMsg);
      }
    }
   
      protected ACLMessage prepareResultNotification(ACLMessage request, ACLMessage response) throws FailureException {
        ACLMessage reply = request.createReply();
      if (action instanceof GetAllLoggers){
        handleGetAllLoggers((GetAllLoggers)action, actExpr, reply);
      }
      else if(action instanceof SetFile){
        handleSetFile((SetFile)action, actExpr, reply);
View Full Code Here


            line = br.readLine();
          }
          char[] chararray = theMessageLine.toCharArray();

          StringACLCodec codec = new StringACLCodec(new StringReader(new String(chararray)), null);
          ACLMessage theMsg = codec.decode();

          this.addMessageNode(direction, theTime, theMsg);

        }
        br.close();
View Full Code Here

    super(failure);
  }

  public ACLMessage getACLMessage() {
    if (msg == null) {
      msg = new ACLMessage(ACLMessage.FAILURE);
      msg.setContent(getMessage());
    }
    return msg;
  }
View Full Code Here

    super(refuse);
  }

  public ACLMessage getACLMessage() {
    if (msg == null) {
      msg = new ACLMessage(ACLMessage.REFUSE);
      msg.setContent(getMessage());
    }
    return msg;
  }
View Full Code Here

    if (notifyFailure) {
      Iterator it = pendingMsg.iterator();
      while (it.hasNext()) {
        try {
          Object[] removed = (Object[]) it.next();
          ACLMessage msg = (ACLMessage) removed[0];
          AID receiver = new AID((String) removed[1], AID.ISLOCALNAME);           
          ServiceFinder myFinder = getServiceFinder();
          MessagingService msgSvc = (MessagingService) myFinder.findService(MessagingSlice.NAME);
          msgSvc.notifyFailureToSender(new GenericMessage(msg), receiver, new InternalError("Agent dead"))
        }
View Full Code Here

   
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
      int height = myIcon.getIconHeight();
      if(table.getRowHeight() != height)
        table.setRowHeight(height);
      ACLMessage msg = (ACLMessage)value;
      setText(ACLMessage.getPerformative(msg.getPerformative()));
      setBackground(isSelected ? Color.cyan : Color.white);
      return this;
    }
View Full Code Here

        needClone = needClone || it.hasNext();
        isFirst = false;
      }
      GenericCommand cmd = new GenericCommand(jade.core.messaging.MessagingSlice.SEND_MESSAGE, jade.core.messaging.MessagingSlice.NAME, null);
      cmd.addParam(sender);
      ACLMessage toBeSent = null;
      if (needClone) {
        toBeSent = (ACLMessage) msg.clone();
      }
      else {
        toBeSent = msg;
View Full Code Here

   to perform certain actions (createAgent, killContainer) asynchronously
   */
  private void sendFailureNotification(final Concept action, final Object key, final FIPAException fe) {
    addBehaviour(new OneShotBehaviour(this) {
      public void action() {
        ACLMessage notification = null;
        if (action instanceof CreateAgent) {
          notification = (ACLMessage) pendingNewAgents.remove(key);
        } else if (action instanceof KillContainer) {
          notification = (ACLMessage) pendingRemovedContainers.remove(key);
        }
        if (notification != null) {
          notification.setPerformative(ACLMessage.FAILURE);
          // Compose the content
          Action slAction = new Action(getAID(), action);
          ContentElementList cel = new ContentElementList();
          cel.add(slAction);
          cel.add(fe);
          try {
            getContentManager().fillContent(notification, cel);
          } catch (Exception e) {
            // Should never happen
            e.printStackTrace();
            notification.setContent("(" + fe.getMessage() + ")");
          }
          send(notification);
        }
      }
    });
View Full Code Here

    }

    public void action() {

      // Receive 'subscribe' ACL messages.
      ACLMessage current = receive(subscriptionTemplate);
      if (current != null) {

        // FIXME: Should parse 'iota ?x ...'

        // Get new tool name from subscription message
        AID newTool = current.getSender();
        toolNotification.clearAllReceiver();
        toolNotification.addReceiver(newTool);

        try {
          // Send a 'Reset' meta-event
View Full Code Here

    }

    public void action() {

      // Receive 'cancel' ACL messages.
      ACLMessage current = receive(cancellationTemplate);
      if (current != null) {
        // FIXME: Should parse the content

        // Remove this tool from tools agent group.
        myPlatform.removeTool(current.getSender());

      } else
        block();

    }
View Full Code Here

TOP

Related Classes of jade.lang.acl.ACLMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.