Package jade.core

Examples of jade.core.ContainerID


   
    MainContainer impl = myContainer.getMain();
    if (impl != null) {
      // Directly use the GADT on the main container
      while (true) {
        ContainerID cid = getAgentLocation(receiverID);
        MessagingSlice targetSlice = oneShotDeliver(cid, msg, receiverID);
        if (targetSlice != null) {
          return;
        }
      }
View Full Code Here


  }
 
 
  private void deliverUntilOK(GenericMessage msg, AID receiverID) throws IMTPException, NotFoundException, ServiceException, JADESecurityException {
    while (true) {
      ContainerID cid = null;
      try {
        MessagingSlice mainSlice = (MessagingSlice) getSlice(MAIN_SLICE);
        try {
          cid = mainSlice.getAgentLocation(receiverID);
        }
View Full Code Here

  AID agentAid = new AID();
  agentAid.setName(agentName);

  String containerName = JOptionPane.showInputDialog(wnd, "Enter container name");
  if(containerName != null) {
      ContainerID newContainer = new ContainerID();
      newContainer.setName(containerName);
      myRMA.thawAgent(agentAid, "JADE-DB", newContainer);
  }
    }
View Full Code Here

    private MTPDescriptor handleInstallMTP(VerticalCommand cmd)
        throws IMTPException, ServiceException, NotFoundException, MTPException {
        Object[] params = cmd.getParams();
        String address = (String) params[0];
        ContainerID cid = (ContainerID) params[1];
        String className = (String) params[2];

        MessagingSlice targetSlice = (MessagingSlice) getSlice(cid.getName());

        return targetSlice.installMTP(address, className);
    }
View Full Code Here

    private void handleUninstallMTP(VerticalCommand cmd)
        throws IMTPException, ServiceException, NotFoundException, MTPException {
        Object[] params = cmd.getParams();
        String address = (String) params[0];
        ContainerID cid = (ContainerID) params[1];

        MessagingSlice targetSlice = (MessagingSlice) getSlice(cid.getName());
        targetSlice.uninstallMTP(address);
    }
View Full Code Here

  }
 
  void pingNode(String nodeID) throws IMTPException {
    try {
      // This method is invoked by the UDPMonitorServer --> it can only be invoked on a Main Container
      NodeDescriptor dsc = mainContainer.getContainerNode(new ContainerID(nodeID, null));
      dsc.getNode().ping(false);
    }
    catch (NotFoundException nfe) {
      // Node unknown! This should never happen. DO as if it was unreachable
      throw new IMTPException("Unknown node");
View Full Code Here

    try {
      impl.bornAgent(agentID, cid, principal, ownership, forceReplacement);
    }
    catch(NameClashException nce) {
      try {
        ContainerID oldCid = impl.getContainerID(agentID);
        Node n = impl.getContainerNode(oldCid).getNode();
       
        // Perform a non-blocking ping to check...
        n.ping(false);
       
View Full Code Here

      AID agentID = (AID)params[0];
      Location where = (Location)params[1];
     
      MainContainer impl = myContainer.getMain();
      if(impl != null) {
        ContainerID cid = impl.getContainerID(agentID);
        AgentMobilitySlice targetSlice = (AgentMobilitySlice)getSlice(cid.getName());
        try {
          targetSlice.moveAgent(agentID, where);
        }
        catch(IMTPException imtpe) {
          // Try to get a newer slice and repeat...
          targetSlice = (AgentMobilitySlice)getFreshSlice(cid.getName());
          targetSlice.moveAgent(agentID, where);
        }
      }
      else {
        // Do nothing for now, but could also route the command to the main slice, thus enabling e.g. AMS replication
View Full Code Here

      Location where = (Location)params[1];
      String newName = (String)params[2];
     
      MainContainer impl = myContainer.getMain();
      if(impl != null) {
        ContainerID cid = impl.getContainerID(agentID);
        AgentMobilitySlice targetSlice = (AgentMobilitySlice)getSlice(cid.getName());
        try {
          targetSlice.copyAgent(agentID, where, newName);
        }
        catch(IMTPException imtpe) {
          // Try to get a newer slice and repeat...
          targetSlice = (AgentMobilitySlice)getFreshSlice(cid.getName());
          targetSlice.copyAgent(agentID, where, newName);
        }
      }
      else {
        // Do nothing for now, but could also route the command to the main slice, thus enabling e.g. AMS replication
View Full Code Here

      // Avoid propagating to other slices in case the agent creation failed due to a name-clash
      if (!(ret != null && ret instanceof NameClashException)) {
        Object[] params = cmd.getParams();

        AID agentID = (AID) params[0];
        ContainerID cid = (ContainerID) params[1];

        GenericCommand hCmd = new GenericCommand(MainReplicationSlice.H_BORNAGENT, MainReplicationSlice.NAME, null);
        hCmd.addParam(agentID);
        hCmd.addParam(cid);
        hCmd.setPrincipal(cmd.getPrincipal());
View Full Code Here

TOP

Related Classes of jade.core.ContainerID

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.