Package jade.util.leap

Examples of jade.util.leap.List


    }
  }
 
  private void notifyPendingEvents(AID id) {
    synchronized (pendingEvents) {
      List l = (List) pendingEvents.remove(id);
      if (l != null) {
        Iterator it = l.iterator();
        while (it.hasNext()) {
          JADEEvent ev = (JADEEvent) it.next();
          ev.notifyProcessed(null);
        }
      }
View Full Code Here


 
  private void notifyAllPendingEvents() {
    synchronized (pendingEvents) {
      Iterator it1 = pendingEvents.values().iterator();
      while (it1.hasNext()) {
        List l = (List) it1.next();
        Iterator it2 = l.iterator();
        while (it2.hasNext()) {
          JADEEvent ev = (JADEEvent) it2.next();
          ev.notifyProcessed(null);
        }
      }
View Full Code Here

    setPropertyIfNot(SERVICES, DEFAULT_SERVICES);
   
    //#MIDP_EXCLUDE_BEGIN
    // Set agents as a list to handle the "gui" option
    try {
      List   agents = getSpecifiers(AGENTS);
      String isGui = props.getProperty("gui");
     
      if (isGui != null && CaseInsensitiveString.equalsIgnoreCase(isGui, "true")) {
        Specifier s = new Specifier();
       
        s.setName("rma");
        s.setClassName("jade.tools.rma.rma");
        agents.add(0, s);
        props.put(AGENTS, agents);
      }
    }
    catch(ProfileException pe) {
      // FIXME: Should throw?
      pe.printStackTrace();
    }
    //#MIDP_EXCLUDE_END
   
    //#J2ME_EXCLUDE_BEGIN
       
    // If this is a Main Container and the '-nomtp' option is not
    // given, activate the default HTTP MTP (unless some MTPs have
    // been directly provided).
    if(isMain() && (!getBooleanProperty("nomtp", false)) && (props.getProperty(MTPS) == null)) {
      Specifier s = new Specifier();
      s.setClassName("jade.mtp.http.MessageTransportProtocol");
      List l = new ArrayList(1);
      l.add(s);
      props.put(MTPS, l);
    }
    //#J2ME_EXCLUDE_END
   
  }
View Full Code Here

    // The list should be present as a string --> parse it
    String    specsLine = getParameter(key, null);
    try {
      Vector v = Specifier.parseSpecifierList(specsLine);
      // convert the vector into an arraylist (notice that using the vector allows to avoid class loading of ArrayList)
      List l1 = new ArrayList(v.size());
      for (int i=0; i<v.size(); i++)
        l1.add(v.elementAt(i));
      return l1;
    }
    catch (Exception e) {
      throw new ProfileException("Error parsing specifier list "+specsLine+".", e);
    }
View Full Code Here

     //FIXME for applet I have not the agent c = sender.lookupLanguage(SL0Codec.NAME);
     //if (c == null)
       c = new SLCodec();

     // Write the action in the :content slot of the request
     List content = new ArrayList();
     content.add(act);

     try {
      String s = ((SLCodec)c).encode(o, (AbsContentElement)o.fromObject(act));
      this.reqMsg.setContent(s);
    } catch(OntologyException oe) {
View Full Code Here

    if(lastMsg.getPerformative() != ACLMessage.INFORM)
      throw new FIPAException(lastMsg);

    Result r = AppletRequestProto.extractContent(lastMsg.getContent(),(SLCodec)c,o);
    Iterator i = r.getItems().iterator(); //this is the set of DFAgentDescription
    List l = new ArrayList();
    while (i.hasNext())
     l.add(i.next());
    return l;

  }
View Full Code Here

            else
            if(this.action.equalsIgnoreCase(DFAppletVocabulary.GETDESCRIPTION))
            {
              //UPDATE the thisDf variable.
             try{
               List result = getResult();
               dfApplet.setDescription((DFAgentDescription)result.get(0));
             }catch(NotYetReady nyr){
               //FIXME: what should happen in this case ?
              nyr.printStackTrace();
             }
            }
View Full Code Here

  /**
   */
  public List getLocalAddresses() throws IMTPException {
    try {
      List l = new LinkedList();
      // The port is meaningful only on the Main container
      TransportAddress addr = new RMIAddress(InetAddress.getLocalHost().getHostName(), String.valueOf(localPort), null, null);
      l.add(addr);
      return l;
    }
    catch (Exception e) {
      throw new IMTPException("Exception reading local addresses", e);
    }
View Full Code Here

      addresses.add(ta);
      urls.add(url);
     
      // Put the peer in the table of local ICPs.
      String proto = tp.getName().toLowerCase();
      List                  list = (List) icps.get(proto);
      if (list == null) {
        icps.put(proto, (list = new ArrayList()));
      }
     
      list.add(peer);
    }
    catch (ICPException icpe) {
      // Print a warning.
      myLogger.log(Logger.WARNING, "Error adding ICP "+peer+"["+icpe.getMessage()+"].");
    }
View Full Code Here

      myLogger.log(Logger.WARNING, "Error adding ICP "+peer+"["+icpe.getMessage()+"].");
    }
  }
 
  TransportProtocol getProtocol(String protoName) {
    List list = (List) icps.get(protoName.toLowerCase());
    if (list != null && list.size() > 0) {
      ICP icp = (ICP) list.get(0);
      return icp.getProtocol();
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of jade.util.leap.List

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.