Package jade.core

Examples of jade.core.GenericCommand


public class NotificationProxy extends SliceProxy implements NotificationSlice {


  public void sniffOn(AID snifferName, AID targetName) throws IMTPException {
    try {
      GenericCommand cmd = new GenericCommand(H_SNIFFON, NotificationSlice.NAME, null);
      cmd.addParam(snifferName);
      cmd.addParam(targetName);


      Node n = getNode();
      Object result = n.accept(cmd);
      if((result != null) && (result instanceof Throwable)) {
View Full Code Here


    }
  }

  public void sniffOff(AID snifferName, AID targetName) throws IMTPException {
    try {
      GenericCommand cmd = new GenericCommand(H_SNIFFOFF, NotificationSlice.NAME, null);
      cmd.addParam(snifferName);
      cmd.addParam(targetName);


      Node n = getNode();
      Object result = n.accept(cmd);
      if((result != null) && (result instanceof Throwable)) {
View Full Code Here

    }
  }

  public void debugOn(AID introspectorName, AID targetName) throws IMTPException {
    try {
      GenericCommand cmd = new GenericCommand(H_DEBUGON, NotificationSlice.NAME, null);
      cmd.addParam(introspectorName);
      cmd.addParam(targetName);


      Node n = getNode();
      Object result = n.accept(cmd);
      if((result != null) && (result instanceof Throwable)) {
View Full Code Here

    }
  }

  public void debugOff(AID introspectorName, AID targetName) throws IMTPException {
    try {
      GenericCommand cmd = new GenericCommand(H_DEBUGOFF, NotificationSlice.NAME, null);
      cmd.addParam(introspectorName);
      cmd.addParam(targetName);


      Node n = getNode();
      Object result = n.accept(cmd);
      if((result != null) && (result instanceof Throwable)) {
View Full Code Here

    public boolean isMessageAware() {
      return messageAware;
    }
   
    public void informMoved(AID agentID, Location where) throws ServiceException, JADESecurityException, NotFoundException, IMTPException {
      GenericCommand cmd = new GenericCommand(AgentMobilityHelper.INFORM_MOVED, AgentMobilitySlice.NAME, null);
      cmd.addParam(agentID);
      cmd.addParam(where);
      // Set the credentials of the moving agent
      myService.initCredentials(cmd, agentID);
     
      Object lastException = myService.submit(cmd);
      if(lastException != null) {
View Full Code Here

        myLogger.log(Logger.SEVERE,"***  Agent " + myAgent.getName() + " cloned in a forbidden situation ***");
      myAgent.clean(true);
    }
   
    public void informCloned(AID agentID, Location where, String newName) throws ServiceException, JADESecurityException, IMTPException, NotFoundException, NameClashException {
      GenericCommand cmd = new GenericCommand(AgentMobilityHelper.INFORM_CLONED, AgentMobilitySlice.NAME, null);
      cmd.addParam(agentID);
      cmd.addParam(where);
      cmd.addParam(newName);
      // Set the credentials of the cloning agent
      myService.initCredentials(cmd, agentID);
     
      Object lastException = myService.submit(cmd);
      if(lastException != null) {
View Full Code Here

public class SAMProxy extends SliceProxy implements SAMSlice {
  private static final long serialVersionUID = 87469234984L;

  public SAMInfo getSAMInfo() throws IMTPException {
    try {
      GenericCommand cmd = new GenericCommand(H_GETSAMINFO, SAMHelper.SERVICE_NAME, null);
     
      Node n = getNode();
      Object result = n.accept(cmd);
      if (result instanceof IMTPException) {
        throw (IMTPException)result;
View Full Code Here

      String content = "( (action " + msg.getSender().toString();
      content = content + " (ACLMessage) ) (MTS-error "+receiver+" "+ie.getMessage() + ") )";
      failure.setContent(content);
     
      try {
        GenericCommand command = new GenericCommand(MessagingSlice.SEND_MESSAGE, MessagingSlice.NAME, null);
        command.addParam(theAMS);
        GenericMessage gm = new GenericMessage(failure);
        gm.setAMSFailure(true);
        command.addParam(gm);
        command.addParam((AID)(failure.getAllReceiver().next()));
        // FIXME: We should set the AMS principal and credentials
       
        submit(command);
      }
      catch(ServiceException se) {
View Full Code Here

        String[] addresses = result.getAddresses();
        for(int i = 0; i < addresses.length; i++) {
          myContainer.addAddressToLocalAgents(addresses[i]);
        }
       
        GenericCommand gCmd = new GenericCommand(MessagingSlice.NEW_MTP, MessagingSlice.NAME, null);
        gCmd.addParam(result);
        gCmd.addParam(myContainer.getID());
        submit(gCmd);
       
        return result;
      }
      /*#DOTNET_INCLUDE_BEGIN
 
View Full Code Here

        String[] addresses = desc.getAddresses();
        for(int i = 0; i < addresses.length; i++) {
          myContainer.removeAddressFromLocalAgents(addresses[i]);
        }
       
        GenericCommand gCmd = new GenericCommand(MessagingSlice.DEAD_MTP, MessagingSlice.NAME, null);
        gCmd.addParam(desc);
        gCmd.addParam(myContainer.getID());
        submit(gCmd);       
      }
      else {
        throw new MTPException("No such address was found on this container: " + address);
      }
View Full Code Here

TOP

Related Classes of jade.core.GenericCommand

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.