Package jade.util.leap

Examples of jade.util.leap.Map


      }
    }
  }
 
  private Map loadSubscriptionsCache() {
    Map m = new HashMap();
    Enumeration e = kBase.getSubscriptions();
    while (e.hasMoreElements()) {
      SubscriptionResponder.Subscription sub = (SubscriptionResponder.Subscription) e.nextElement();
     
      try {
        AbsIRE absIota = (AbsIRE) cm.extractAbsContent(sub.getMessage());
        AbsPredicate absResult = absIota.getProposition();
        AbsAgentAction absAction = (AbsAgentAction) absResult.getAbsObject(BasicOntology.RESULT_ACTION);
        AbsAgentAction absSearch = (AbsAgentAction) absAction.getAbsObject(BasicOntology.ACTION_ACTION);
        Search search = (Search) FIPAManagementOntology.getInstance().toObject(absSearch);   
        DFAgentDescription template = (DFAgentDescription) search.getDescription();
       
        m.put(sub.getMessage().getConversationId(), new SubscriptionInfo(sub, template, absIota));
      }
      catch (Exception ex) {
        // Should never happen since, this has already been decoded correctly once
        ex.printStackTrace();
      }
View Full Code Here


      NodeDescriptor nodeDsc = (NodeDescriptor) allNodes[i];
      infos.add(new NodeInfo(nodeDsc));
    }

    // Build the map of services for each node
    Map nodeServices = new HashMap();
    // Avoid concurrent modification exception
    Object[] allServices = services.values().toArray();
    for (int j = 0; j < allServices.length; ++j) {
      ServiceEntry e = (ServiceEntry) allServices[j];
      Node[] serviceNodes = e.getNodes();

      for (int i = 0; i < serviceNodes.length; i++) {
        String nodeName = serviceNodes[i].getName();

        Vector v = (Vector) nodeServices.get(nodeName);
        if (v == null) {
          v = new Vector();
          nodeServices.put(nodeName, v);
        }
        Service svc = e.getService();
        v.addElement(new ServiceDescriptor(svc.getName(), svc));
      }
    }

    // Now fill the services in the list of NodeInfo
    Iterator it = infos.iterator();
    while (it.hasNext()) {
      NodeInfo ni = (NodeInfo) it.next();
      Vector v = (Vector) nodeServices.get(ni.getNodeDescriptor().getName());
      ni.setServices(v);
    }
    return infos;
  }
View Full Code Here

TOP

Related Classes of jade.util.leap.Map

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.