Package jade.util.leap

Examples of jade.util.leap.LinkedList


  private int maxSize;

  public InternalMessageQueue(int size) {
    maxSize = size;
    //#MIDP_EXCLUDE_BEGIN
    list = new LinkedList();
    //#MIDP_EXCLUDE_END
    /*#MIDP_INCLUDE_BEGIN
     list = new Vector();
     #MIDP_INCLUDE_END*/
  }
 
View Full Code Here


     
      // Update the map of debuggers currently debugging the targetName agent
      synchronized (debuggers) {
        List l = (List) debuggers.get(targetName);
        if (l == null) {
          l = new LinkedList();
          debuggers.put(targetName, l);
        }
        if (!l.contains(introspectorName)) {
          l.add(introspectorName);
        }
      }
     
      Agent a = myContainer.acquireLocalAgent(targetName);
     
      // Activate generation of behaviour-related events on the
      // target agent
      a.setGenerateBehaviourEvents(true);
     
      // Retrieve the current agent state
      AgentState as = a.getAgentState();
     
      // Retrieve the list of pending ACL messages
      List messages = new LinkedList();
      myContainer.fillListFromMessageQueue(messages, a);
     
      // Retrieve the list of ready and blocked agent behaviour IDs
      List readyBehaviours = new LinkedList();
      myContainer.fillListFromReadyBehaviours(readyBehaviours, a);
      List blockedBehaviours = new LinkedList();
      myContainer.fillListFromBlockedBehaviours(blockedBehaviours, a);
     
      myContainer.releaseLocalAgent(targetName);
     
      // Notify all the needed events 
      fireChangedAgentState(targetName, as, as);
     
      Iterator itReady = readyBehaviours.iterator();
      while(itReady.hasNext()) {
        BehaviourID bid = (BehaviourID)itReady.next();
        AgentEvent ev = new AgentEvent(AgentEvent.ADDED_BEHAVIOUR, targetName, bid, myContainer.getID());
        tn.addedBehaviour(ev);
      }
     
      Iterator itBlocked = blockedBehaviours.iterator();
      while(itBlocked.hasNext()) {
        BehaviourID bid = (BehaviourID)itBlocked.next();
        AgentEvent ev = new AgentEvent(AgentEvent.ADDED_BEHAVIOUR, targetName, bid, myContainer.getID());
        tn.addedBehaviour(ev);
        ev = new AgentEvent(AgentEvent.CHANGED_BEHAVIOUR_STATE, targetName, bid, Behaviour.STATE_READY, Behaviour.STATE_BLOCKED, myContainer.getID());
View Full Code Here

  * Constructs a new, empty HashCache with the specified size.
  * @param cacheSize is the size of this cache
  **/
  public HashCache(int cacheSize)
  {
    list = new LinkedList();
    ht = new HashMap(cacheSize);
    cs = cacheSize;
  }
View Full Code Here

    //#APIDOC_EXCLUDE_BEGIN
 
  protected void onWriteStart() {
    if (innerList == null) {
      innerList = new LinkedList();
    }
  }
View Full Code Here

  public GenericCommand(String name, String service, String interaction) {
    myName = name;
    myService = service;
    myInteraction = interaction;
   
    params = new LinkedList();
  }
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

      private final List messages;
   
    public Box(AID r) {
      receiver = r;
      busy = false;
      messages = new LinkedList();
    }
View Full Code Here

          // Put the item into the pending messages table
          synchronized(pendingMessages) {
            List msgs = (List)pendingMessages.get(receiver);
            if(msgs == null) {
              msgs = new LinkedList();
              pendingMessages.put(receiver, msgs);
            }

            DeliveryItem item = new DeliveryItem(msg, receiver, deliveryChannel, storeName);
            msgs.add(item);
View Full Code Here

    // Store the ACL message and its receiver for later re-delivery...
    synchronized(pendingMessages) {
      List msgs = (List)pendingMessages.get(receiver);
      if(msgs == null) {
        msgs = new LinkedList();
        pendingMessages.put(receiver, msgs);
      }

      String tmpName = storage.store(msg, receiver);
      msgs.add(new DeliveryItem(msg, receiver, deliveryChannel, tmpName));
View Full Code Here

TOP

Related Classes of jade.util.leap.LinkedList

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.