Package jade.content.onto.basic

Examples of jade.content.onto.basic.Action


  public void shutDownPlatform() {
    if(myGUI.showExitDialog("Shut down the platform")) {
     
      ShutdownPlatform sp = new ShutdownPlatform();
      try {
        Action a = new Action();
        a.setActor(getAMS());
        a.setAction(sp);
       
        ACLMessage requestMsg = getRequest();
        requestMsg.setOntology(JADEManagementOntology.NAME);
        getContentManager().fillContent(requestMsg, a);
        addBehaviour(new AMSClientBehaviour("ShutdownPlatform", requestMsg));
View Full Code Here


  public void installMTP(String containerName) {
    InstallMTP imtp = new InstallMTP();
    imtp.setContainer(new ContainerID(containerName, null));
    if(myGUI.showInstallMTPDialog(imtp)) {
      try {
        Action a = new Action();
        a.setActor(getAMS());
        a.setAction(imtp);
       
        ACLMessage requestMsg = getRequest();
        requestMsg.setOntology(JADEManagementOntology.NAME);
        getContentManager().fillContent(requestMsg, a);
        addBehaviour(new AMSClientBehaviour("InstallMTP", requestMsg));
View Full Code Here

  public void uninstallMTP(String containerName, String address) {
    UninstallMTP umtp = new UninstallMTP();
    umtp.setContainer(new ContainerID(containerName, null));
    umtp.setAddress(address);
    try {
      Action a = new Action();
      a.setActor(getAMS());
      a.setAction(umtp);
     
      ACLMessage requestMsg = getRequest();
      requestMsg.setOntology(JADEManagementOntology.NAME);
      getContentManager().fillContent(requestMsg, a);
      addBehaviour(new AMSClientBehaviour("UninstallMTP", requestMsg));
View Full Code Here

      requestMsg.setProtocol(FIPANames.InteractionProtocol.FIPA_REQUEST);
      requestMsg.setLanguage(FIPANames.ContentLanguage.FIPA_SL0);
      requestMsg.setOntology(FIPAManagementOntology.NAME);
     
      GetDescription action = new GetDescription();
      Action a = new Action();
      a.setActor(remoteAMS);
      a.setAction(action);
     
      getContentManager().fillContent(requestMsg,a);
      addBehaviour(new handleAddRemotePlatformBehaviour("GetDescription",requestMsg));
     
    }catch(Exception e){
View Full Code Here

  public void refreshRemoteAgent(APDescription platform,AID ams){
    try{
      // FIXME. Move all this block into the constructor for better performance
      // because it is invariant to the method parameters
      ACLMessage request; // variable that keeps the request search message
      Action act;  // variable that keeps the search action
      request = new ACLMessage(ACLMessage.REQUEST);
      request.setProtocol(FIPANames.InteractionProtocol.FIPA_REQUEST);
      request.setLanguage(FIPANames.ContentLanguage.FIPA_SL0);
      request.setOntology(FIPAManagementOntology.NAME);
      AMSAgentDescription amsd = new AMSAgentDescription();
      SearchConstraints constraints = new SearchConstraints();
      constraints.setMaxResults(new Long(-1)); // all results back
      // Build a AMS action object for the request
      Search s = new Search();
      s.setDescription(amsd);
      s.setConstraints(constraints);
      act = new Action();
      act.setAction(s);
     
      // request has been already initialized in the constructor
      request.clearAllReceiver();
      request.addReceiver(ams);   
      act.setActor(ams); // set the actor of this search action
      getContentManager().fillContent(request, act);
     
      addBehaviour(new handleRefreshRemoteAgentBehaviour ("search",request,platform));
     
    }catch(Exception e){
View Full Code Here

   
    Register register_act = new Register();
    register_act.setDescription(amsd);
   
    try{
      Action a = new Action();
      a.setActor(getAMS());
      a.setAction(register_act);
     
      ACLMessage requestMsg = getRequest();
      requestMsg.setOntology(FIPAManagementOntology.NAME);
      getContentManager().fillContent(requestMsg, a);
     
View Full Code Here

          empty = false;
        }
      }
      if(!empty) {
        try {
          Action a = new Action();
          a.setActor(getAMS());
          a.setAction(so);

          ACLMessage requestMsg = getRequest();
          requestMsg.setOntology(JADEManagementOntology.NAME);
          getContentManager().fillContent(requestMsg, a);
          return requestMsg;
        }
        catch(Exception fe) {
          fe.printStackTrace();
        }
      }
    }

    else {
      SniffOff so = new SniffOff();
      so.setSniffer(getAID());
      boolean empty = true;
      while(it.hasNext()) {
        Agent a = (Agent)it.next();
        AID agentID = new AID();
        agentID.setName(a.agentName + '@' + getHap());
        if(agentsUnderSniff.contains(a)) {
          agentsUnderSniff.remove(a);
          so.addSniffedAgents(agentID);
          empty = false;
        }
      }
      if(!empty) {
        try {
          Action a = new Action();
          a.setActor(getAMS());
          a.setAction(so);

          ACLMessage requestMsg = getRequest();
          requestMsg.setOntology(JADEManagementOntology.NAME);
          getContentManager().fillContent(requestMsg, a);
          requestMsg.setReplyWith(getName()+ (new Date().getTime()));
View Full Code Here

     msg = new ACLMessage(ACLMessage.REQUEST);
     msg.addReceiver(myRMA.getDefaultDF());
     msg.setOntology(JADEManagementOntology.NAME);
     msg.setLanguage(FIPANames.ContentLanguage.FIPA_SL0);
     msg.setProtocol(FIPANames.InteractionProtocol.FIPA_REQUEST);
     Action a = new Action();
     a.setActor(myRMA.getDefaultDF());
     a.setAction(new ShowGui());
    
     try {
       myRMA.getContentManager().fillContent(msg,a);
     } catch (Exception e) {
       e.printStackTrace();
View Full Code Here

          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);
View Full Code Here

    try
      // Check the language is SL0, SL1, SL2 or SL.
      isAnSLRequest(request);

      // Extract the content
      Action slAction = (Action) myAgent.getContentManager().extractContent(request);

      // Perform the action
      notification = performAction(slAction, request);

      // Action OK
View Full Code Here

TOP

Related Classes of jade.content.onto.basic.Action

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.