Package jade.core

Examples of jade.core.GenericCommand


  }
    }*/

    public void newTool(AID tool) throws IMTPException {
  try {
      GenericCommand cmd = new GenericCommand(H_NEWTOOL, NAME, null);
      cmd.addParam(tool);

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


    public void handleAddressAdded(VerticalCommand cmd) throws IMTPException, ServiceException {
      Object[] params = cmd.getParams();
      String addr = (String)params[0];

      // Broadcast the new address to all the slices...
      GenericCommand hCmd = new GenericCommand(AddressNotificationSlice.H_ADDSERVICEMANAGERADDRESS, AddressNotificationSlice.NAME, null);
      hCmd.addParam(addr);

      broadcastToSlices(hCmd);
    }
View Full Code Here

*/
public class AddressNotificationProxy extends SliceProxy implements AddressNotificationSlice {

    public void addServiceManagerAddress(String addr) throws IMTPException {
  try {
      GenericCommand cmd = new GenericCommand(H_ADDSERVICEMANAGERADDRESS, NAME, null);
      cmd.addParam(addr);

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

*/
public class PersistentDeliveryProxy extends SliceProxy implements PersistentDeliverySlice {

  public boolean storeMessage(String storeName, GenericMessage msg, AID receiver) throws IMTPException, NotFoundException {
    try {
      GenericCommand cmd = new GenericCommand(H_STOREMESSAGE, NAME, null);
      cmd.addParam(storeName);
      // NOTE that we can't send the GenericMessage directly as a parameter
      // since we would loose the embedded ACLMessage
      cmd.addParam(msg.getACLMessage());
      cmd.addParam(msg.getEnvelope());
      cmd.addParam(msg.getPayload());
      cmd.addParam(new Boolean(msg.hasForeignReceiver()));
      cmd.addParam(msg.getTraceID());
      cmd.addParam(receiver);

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

  }
    }*/

    public String getServiceManagerAddress() throws IMTPException {
  try {
      GenericCommand cmd = new GenericCommand(H_GETSERVICEMANAGERADDRESS, NAME, null);

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

    }
  }

  public void flushMessages(AID receiver) throws IMTPException {
    try {
      GenericCommand cmd = new GenericCommand(H_FLUSHMESSAGES, NAME, null);
      cmd.addParam(receiver);

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

public class AgentMobilityProxy extends SliceProxy implements AgentMobilitySlice {


  public void createAgent(AID agentID, byte[] serializedInstance, String classSiteName, boolean isCloned, boolean startIt) throws IMTPException, ServiceException, NotFoundException, NameClashException, JADESecurityException {
    try {
      GenericCommand cmd = new GenericCommand(H_CREATEAGENT, AgentMobilitySlice.NAME, null);
      cmd.addParam(agentID);
      cmd.addParam(serializedInstance);
      cmd.addParam(classSiteName);
      cmd.addParam(new Boolean(isCloned));
      cmd.addParam(new Boolean(startIt));


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

  }
 
  public void invokeReplicatedMethod(String methodName, Object[] params) {
    //#J2ME_EXCLUDE_BEGIN
    if (replicationService != null) {
      GenericCommand cmd = new GenericCommand(MainReplicationSlice.H_INVOKESERVICEMETHOD, MainReplicationSlice.NAME, null);
      cmd.addParam(myService);
      cmd.addParam(methodName);
      cmd.addParam(params);
      try {
        replicationService.broadcastToReplicas(cmd, false);
      }
      catch (Exception e) {
        // Should never happen as real exceptions are logged inside broadcastToReplicas()
        myLogger.log(Logger.WARNING, "Error propagating H-command " + cmd.getName() +" to replicas. Method to invoke on replicas was "+methodName, e);
      }
    }
    //#J2ME_EXCLUDE_END
  }
View Full Code Here

    }
  }

  public byte[] fetchClassFile(String className, String agentName) throws IMTPException, ClassNotFoundException {
    try {
      GenericCommand cmd = new GenericCommand(H_FETCHCLASSFILE, AgentMobilitySlice.NAME, null);
      cmd.addParam(className);
      cmd.addParam(agentName);


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

    }
  }

  public void moveAgent(AID agentID, Location where) throws IMTPException, NotFoundException {
    try {
      GenericCommand cmd = new GenericCommand(H_MOVEAGENT, AgentMobilitySlice.NAME, null);
      cmd.addParam(agentID);
      cmd.addParam(where);


      Node n = getNode();
      Object result = n.accept(cmd);
      if((result != null) && (result instanceof Throwable)) {
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.