Package jade.core

Examples of jade.core.GenericCommand


public class UDPNodeMonitoringProxy extends SliceProxy implements UDPNodeMonitoringSlice {
  /*
   * Request a given node to start sending UDP packets
   */
  public void activateUDP(String label, String host, int port, int pingDelay, long key) throws IMTPException, ServiceException {
    GenericCommand cmd = new GenericCommand(H_ACTIVATEUDP, UDPNodeMonitoringService.NAME, null);
    cmd.addParam(label);
    cmd.addParam(host);
    cmd.addParam(new Integer(port));
    cmd.addParam(new Integer(pingDelay));
    cmd.addParam(new Long(key));

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


  /*
   * Request a given node to stop sending UDP packets
   */
  public void deactivateUDP(String label, long key) throws IMTPException {
    try {
      GenericCommand cmd = new GenericCommand(H_DEACTIVATEUDP, UDPNodeMonitoringService.NAME, null);
      cmd.addParam(label);
      cmd.addParam(new Long(key));
 
      Node n = getNode();
      Object result = n.accept(cmd);
      if ((result != null) && (result instanceof Throwable)) {
        if (result instanceof IMTPException) {
View Full Code Here

    }
  }
 
  void handleOrphanNode(String nodeID) {
    try {
      GenericCommand cmd = new GenericCommand(ORPHAN_NODE, NAME, null);
      cmd.addParam(nodeID);
      submit(cmd);
    }
    catch (Exception e) {
      // Should never happen
      e.printStackTrace();
View Full Code Here

public class MessagingProxy extends SliceProxy implements MessagingSlice {
 
 
  public void dispatchLocally(AID senderID, GenericMessage msg, AID receiverID) throws IMTPException, NotFoundException, JADESecurityException {
    try {
      GenericCommand cmd = new GenericCommand(H_DISPATCHLOCALLY, NAME, null);
      cmd.addParam(senderID);
      cmd.addParam(msg);
      cmd.addParam(receiverID);
      long timeStamp = msg.getTimeStamp();
      if (timeStamp > 0) {
        cmd.addParam(new Long(timeStamp));
      }     
      cmd.setPrincipal(msg.getSenderPrincipal());
      cmd.setCredentials(msg.getSenderCredentials());
     
      Node n = getNode();
      Object result = n.accept(cmd);
      if((result != null) && (result instanceof Throwable)) {
        if(result instanceof IMTPException) {
View Full Code Here

    }
  }
 
  public void routeOut(Envelope env, byte[] payload,AID receiverID, String address) throws IMTPException, MTPException {
    try {
      GenericCommand cmd = new GenericCommand(H_ROUTEOUT, NAME, null);
      cmd.addParam(env);
      cmd.addParam(payload);
      cmd.addParam(receiverID);
      cmd.addParam(address);
     
     
      Node n = getNode();
      Object result = n.accept(cmd);
      if((result != null) && (result instanceof Throwable)) {
View Full Code Here

    }
  }
 
  public ContainerID getAgentLocation(AID agentID) throws IMTPException, NotFoundException {
    try {
      GenericCommand cmd = new GenericCommand(H_GETAGENTLOCATION, NAME, null);
      cmd.addParam(agentID);
     
     
      Node n = getNode();
      Object result = n.accept(cmd);
      if((result != null) && (result instanceof Throwable)) {
View Full Code Here

    }
  }
 
  public MTPDescriptor installMTP(String address, String className) throws IMTPException, ServiceException, MTPException {
    try {
      GenericCommand cmd = new GenericCommand(H_INSTALLMTP, NAME, null);
      cmd.addParam(address);
      cmd.addParam(className);
     
     
      Node n = getNode();
      Object result = n.accept(cmd);
      if((result != null) && (result instanceof Throwable)) {
View Full Code Here

    }
  }
 
  public void uninstallMTP(String address) throws IMTPException, ServiceException, NotFoundException, MTPException {
    try {
      GenericCommand cmd = new GenericCommand(H_UNINSTALLMTP, NAME, null);
      cmd.addParam(address);
     
     
      Node n = getNode();
      Object result = n.accept(cmd);
      if((result != null) && (result instanceof Throwable)) {
View Full Code Here

    }
  }
 
  public void newMTP(MTPDescriptor mtp, ContainerID cid) throws IMTPException, ServiceException {
    try {
      GenericCommand cmd = new GenericCommand(H_NEWMTP, NAME, null);
      cmd.addParam(mtp);
      cmd.addParam(cid);
     
     
      Node n = getNode();
      Object result = n.accept(cmd);
      if((result != null) && (result instanceof Throwable)) {
View Full Code Here

    }
  }
 
  public void deadMTP(MTPDescriptor mtp, ContainerID cid) throws IMTPException, ServiceException {
    try {
      GenericCommand cmd = new GenericCommand(H_DEADMTP, NAME, null);
      cmd.addParam(mtp);
      cmd.addParam(cid);
     
     
      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.