Package jade.mtp

Examples of jade.mtp.MTPDescriptor


      // when the platform will have shut down.
      theAMS.shutdownPlatformAction((ShutdownPlatform)action, request.getSender(), requesterPrincipal, requesterCredentials);
    }
    // INSTALL MTP
    else if (action instanceof InstallMTP) {
      MTPDescriptor dsc = theAMS.installMTPAction((InstallMTP) action, request.getSender());
      result = dsc.getAddresses()[0];
      resultNeeded = true;
    }
    // UNINSTALL MTP
    else if (action instanceof UninstallMTP) {
      theAMS.uninstallMTPAction((UninstallMTP) action, request.getSender());
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];
     
      MessagingSlice mainSlice = (MessagingSlice)getSlice(MAIN_SLICE);
      try {
        mainSlice.newMTP(mtp, cid);
View Full Code Here

      }
    }
   
    private void handleDeadMTP(VerticalCommand cmd) throws IMTPException, ServiceException {
      Object[] params = cmd.getParams();
      MTPDescriptor mtp = (MTPDescriptor)params[0];
      ContainerID cid = (ContainerID)params[1];
     
      MessagingSlice mainSlice = (MessagingSlice)getSlice(MAIN_SLICE);
      try {
        mainSlice.deadMTP(mtp, cid);
View Full Code Here

        // back to the requester
        throw new RuntimeException(((Throwable) ret).getMessage());
      }
    }
   
    MTPDescriptor dsc = (MTPDescriptor)ret;
    /***
     System.out.println("--- New MTP ---");
     System.out.println("Name: " + dsc.getName());
     System.out.println("Addresses: ");
     for(int i = 0; i < dsc.getAddresses().length; i++) {
View Full Code Here

  private void removeAllMTPs(ContainerID cid) {
    try {
      List l = containers.getMTPs(cid);
      Object[] objs = l.toArray();
      for(int i = 0; i < objs.length; i++) {
        MTPDescriptor mtp = (MTPDescriptor)objs[i];
       
        GenericCommand gCmd = new GenericCommand(jade.core.messaging.MessagingSlice.DEAD_MTP, jade.core.messaging.MessagingSlice.NAME, null);
        gCmd.addParam(mtp);
        gCmd.addParam(cid);
        myCommandProcessor.processOutgoing(gCmd);
View Full Code Here

                } else if (cmdName.equals(MessagingSlice.H_UNINSTALLMTP)) {
                    String address = (String) params[0];

                    uninstallMTP(address);
                } else if (cmdName.equals(MessagingSlice.H_NEWMTP)) {
                    MTPDescriptor mtp = (MTPDescriptor) params[0];
                    ContainerID cid = (ContainerID) params[1];

                    newMTP(mtp, cid);
                } else if (cmdName.equals(MessagingSlice.H_DEADMTP)) {
                    MTPDescriptor mtp = (MTPDescriptor) params[0];
                    ContainerID cid = (ContainerID) params[1];

                    deadMTP(mtp, cid);
                } 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);
                }
            } catch (Throwable t) {
View Full Code Here

            addressURL = null;
          }
        }
       
        MessagingSlice s = (MessagingSlice)getSlice(getLocalNode().getName());
        MTPDescriptor mtp = s.installMTP(addressURL, className);
        String[] mtpAddrs = mtp.getAddresses();
        if (f == null) {
          String fileName = myProfile.getParameter(Profile.FILE_DIR, "") + "MTPs-" + myContainer.getID().getName() + ".txt";
          f = new PrintWriter(new FileWriter(fileName));
          sb = new StringBuffer("MTP addresses:");
        }
View Full Code Here

 
  void notifyLocalMTPs() {
    Iterator it = routes.getLocalMTPs();
    while (it.hasNext()) {
      RoutingTable.MTPInfo info = (RoutingTable.MTPInfo) it.next();
      MTPDescriptor mtp = info.getDescriptor();
      ContainerID cid = myContainer.getID();
     
      try {
        MessagingSlice mainSlice = (MessagingSlice)getSlice(MAIN_SLICE);
        try {
          mainSlice.newMTP(mtp, cid);
        }
        catch(IMTPException imtpe) {
          mainSlice = (MessagingSlice)getFreshSlice(MAIN_SLICE);
          mainSlice.newMTP(mtp, cid);
        }
      }
      catch (Exception e) {
        myLogger.log(Logger.WARNING, "Error notifying local MTP "+mtp.getName()+" to Main Container.", e);
      }
    }
  }
View Full Code Here

      uninstallMTP(address);
    }
   
    private void handleNewMTP(VerticalCommand cmd) throws IMTPException, ServiceException {
      Object[] params = cmd.getParams();
      MTPDescriptor mtp = (MTPDescriptor)params[0];
      ContainerID cid = (ContainerID)params[1];
     
      newMTP(mtp, cid);
    }
View Full Code Here

      newMTP(mtp, cid);
    }
   
    private void handleDeadMTP(VerticalCommand cmd) throws IMTPException, ServiceException {
      Object[] params = cmd.getParams();
      MTPDescriptor mtp = (MTPDescriptor)params[0];
      ContainerID cid = (ContainerID)params[1];
     
      deadMTP(mtp, cid);
    }
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.