Package jade.mtp

Examples of jade.mtp.MTPDescriptor


           
            try {
              List mtps = impl.containerMTPs(cid);
              Iterator it = mtps.iterator();
              while(it.hasNext()) {
                MTPDescriptor mtp = (MTPDescriptor)it.next();
                newSlice.addRoute(mtp, cid.getName());
              }
            }
            catch(NotFoundException nfe) {
              // Should never happen
View Full Code Here


        else {
          // Convert the given string into a TransportAddress object and use it
          TransportAddress ta = proto.strToAddr(address);
          proto.activate(dispatcher, ta, myProfile);
        }
        MTPDescriptor result = new MTPDescriptor(proto.getName(), className, new String[] {address}, proto.getSupportedProtocols());
        routes.addLocalMTP(address, proto, result);
       
        String[] pp = result.getSupportedProtocols();
        for (int i = 0; i < pp.length; ++i) {
          //log("Added Route-Via-MTP for protocol "+pp[i], 1);
          if (myLogger.isLoggable(Logger.CONFIG))
            myLogger.log(Logger.CONFIG,"Added Route-Via-MTP for protocol "+pp[i]);
         
        }
       
        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);
View Full Code Here

      RoutingTable.MTPInfo info = routes.removeLocalMTP(address);
      if(info != null) {
        MTP proto = info.getMTP();
        TransportAddress ta = proto.strToAddr(address);
        proto.deactivate(ta);
        MTPDescriptor desc = info.getDescriptor();
        //MTPDescriptor desc = new MTPDescriptor(proto.getName(), proto.getClass().getName(), new String[] {address}, proto.getSupportedProtocols());
       
        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);
View Full Code Here

          gCmd.addParam(address);
         
          result = gCmd;
        }
        else if(cmdName.equals(MessagingSlice.H_NEWMTP)) {
          MTPDescriptor mtp = (MTPDescriptor)params[0];
          ContainerID cid = (ContainerID)params[1];
         
          GenericCommand gCmd = new GenericCommand(MessagingSlice.NEW_MTP, MessagingSlice.NAME, null);
          gCmd.addParam(mtp);
          gCmd.addParam(cid);
         
          result = gCmd;
        }
        else if(cmdName.equals(MessagingSlice.H_DEADMTP)) {
          MTPDescriptor mtp = (MTPDescriptor)params[0];
          ContainerID cid = (ContainerID)params[1];
         
          GenericCommand gCmd = new GenericCommand(MessagingSlice.DEAD_MTP, MessagingSlice.NAME, null);
          gCmd.addParam(mtp);
          gCmd.addParam(cid);
         
          result = gCmd;
        }
        else if(cmdName.equals(MessagingSlice.H_ADDROUTE)) {
          MTPDescriptor mtp = (MTPDescriptor)params[0];
          String sliceName = (String)params[1];
         
          addRoute(mtp, sliceName);
        }
        else if(cmdName.equals(MessagingSlice.H_REMOVEROUTE)) {
          MTPDescriptor mtp = (MTPDescriptor)params[0];
          String sliceName = (String)params[1];
         
          removeRoute(mtp, sliceName);
        }
        else if (cmdName.equals(MessagingSlice.H_NEWALIAS)) {
View Full Code Here

    if (requester != null) {
      if (logger.isLoggable(Logger.FINE))
        logger.log(Logger.FINE, "Agent " + requester + " requesting AMS-get-description");
    }
    theProfile.clearAllAPServices(); // clear all the services and recreate the new APDescription
    MTPDescriptor dr;
    for (Iterator mtps = platformMTPs().iterator(); mtps.hasNext();) {
      dr = (MTPDescriptor) mtps.next();
      // convert from an internal MTPDescriptor to a FIPA APService
      theProfile.addAPServices(new APService(dr.getName(), dr.getAddresses()));
    }
    return theProfile;
  }
View Full Code Here

    try {
      String   name = readUTF();
      String   className = readUTF();
      String[] addresses = readStringArray();
      String[] protoNames = readStringArray();
      return new MTPDescriptor(name, className, addresses, protoNames);
    }
    catch (IOException ioe) {
      throw new LEAPSerializationException("Error deserializing MTPDescriptor");
    }
  }
View Full Code Here

    }

    private void handleNewMTP(VerticalCommand cmd) throws IMTPException, ServiceException {
      Object[] params = cmd.getParams();
      MTPDescriptor mtp = (MTPDescriptor) params[0];
      ContainerID cid = (ContainerID) params[1];

      GenericCommand hCmd = new GenericCommand(MainReplicationSlice.H_NEWMTP, MainReplicationSlice.NAME, null);
      hCmd.addParam(mtp);
      hCmd.addParam(cid);
View Full Code Here

      broadcastToReplicas(hCmd, EXCLUDE_MYSELF);
    }

    private void handleDeadMTP(VerticalCommand cmd) throws IMTPException, ServiceException {
      Object[] params = cmd.getParams();
      MTPDescriptor mtp = (MTPDescriptor) params[0];
      ContainerID cid = (ContainerID) params[1];

      GenericCommand hCmd = new GenericCommand(MainReplicationSlice.H_DEADMTP, MainReplicationSlice.NAME, null);
      hCmd.addParam(mtp);
      hCmd.addParam(cid);
View Full Code Here

          suspendedAgent(name);
        } else if (cmdName.equals(MainReplicationSlice.H_RESUMEDAGENT)) {
          AID name = (AID) params[0];
          resumedAgent(name);
        } else if (cmdName.equals(MainReplicationSlice.H_NEWMTP)) {
          MTPDescriptor mtp = (MTPDescriptor) params[0];
          ContainerID cid = (ContainerID) params[1];
          newMTP(mtp, cid);
        } else if (cmdName.equals(MainReplicationSlice.H_DEADMTP)) {
          MTPDescriptor mtp = (MTPDescriptor) params[0];
          ContainerID cid = (ContainerID) params[1];
          deadMTP(mtp, cid);
        } else if (cmdName.equals(MainReplicationSlice.H_NEWTOOL)) {
          AID tool = (AID) params[0];
          newTool(tool);
View Full Code Here

TOP

Related Classes of jade.mtp.MTPDescriptor

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.