Package jade.core

Examples of jade.core.GenericCommand


    }
  }

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


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


    }
  }

  public boolean prepare() throws IMTPException {
    try {
      GenericCommand cmd = new GenericCommand(H_PREPARE, AgentMobilitySlice.NAME, null);


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

    }
  }

  public boolean transferIdentity(AID agentID, Location src, Location dest) throws IMTPException, NotFoundException {
    try {
      GenericCommand cmd = new GenericCommand(H_TRANSFERIDENTITY, AgentMobilitySlice.NAME, null);
      cmd.addParam(agentID);
      cmd.addParam(src);
      cmd.addParam(dest);


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

    }
  }

  public void handleTransferResult(AID agentID, boolean result, List messages) throws IMTPException, NotFoundException {
    try {
      GenericCommand cmd = new GenericCommand(H_HANDLETRANSFERRESULT, AgentMobilitySlice.NAME, null);
      cmd.addParam(agentID);
      cmd.addParam(new Boolean(result));
      cmd.addParam(messages);


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

    }
  }

  public void clonedAgent(AID agentID, ContainerID cid, Credentials creds) throws IMTPException, JADESecurityException, NotFoundException, NameClashException {
    try {
      GenericCommand cmd = new GenericCommand(H_CLONEDAGENT, AgentMobilitySlice.NAME, null);
      cmd.addParam(agentID);
      cmd.addParam(cid);
      cmd.addParam(creds);


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

  }

  //#J2ME_EXCLUDE_BEGIN
  public void cloneCodeLocatorEntry(AID oldAgentID, AID newAgentID) throws IMTPException, NotFoundException {
    try {
      GenericCommand cmd = new GenericCommand(H_CLONECODELOCATORENTRY, AgentMobilitySlice.NAME, null);
      cmd.addParam(oldAgentID);
      cmd.addParam(newAgentID);

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

    }
  }

  public void removeCodeLocatorEntry(AID name) throws IMTPException, NotFoundException {
    try {
      GenericCommand cmd = new GenericCommand(H_REMOVECODELOCATORENTRY, AgentMobilitySlice.NAME, null);
      cmd.addParam(name);

      Node n = getNode();
      Object result = n.accept(cmd);

      if((result != null) && (result instanceof Throwable)) {
View Full Code Here

*/
public class AgentManagementProxy extends SliceProxy implements AgentManagementSlice {

    public void createAgent(AID agentID, String className, Object arguments[], JADEPrincipal owner, Credentials initialCredentials, boolean startIt, Command sourceCmd) throws IMTPException, NotFoundException, NameClashException, JADESecurityException {
  try {
      GenericCommand cmd = new GenericCommand(H_CREATEAGENT, AgentManagementSlice.NAME, null);
      cmd.addParam(agentID);
      cmd.addParam(className);
      cmd.addParam(arguments);
      cmd.addParam(owner);
      cmd.addParam(initialCredentials);
      cmd.addParam(new Boolean(startIt));
      cmd.setPrincipal(sourceCmd.getPrincipal());
      cmd.setCredentials(sourceCmd.getCredentials());

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

  }
    }

    public void killAgent(AID agentID, Command sourceCmd) throws IMTPException, NotFoundException {
  try {
      GenericCommand cmd = new GenericCommand(H_KILLAGENT, AgentManagementSlice.NAME, null);
      cmd.addParam(agentID);
      cmd.setPrincipal(sourceCmd.getPrincipal());
      cmd.setCredentials(sourceCmd.getCredentials());

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

  }
    }

    public void changeAgentState(AID agentID, int newState) throws IMTPException, NotFoundException {
  try {
      GenericCommand cmd = new GenericCommand(H_CHANGEAGENTSTATE, AgentManagementSlice.NAME, null);
      cmd.addParam(agentID);
      cmd.addParam(new Integer(newState));

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