Package jade.util.leap

Examples of jade.util.leap.Iterator


    // NOTE: A normal synchronized block could create deadlock problems
    // as it prevents concurrent scannings of the listeners list.
    List l = agentListeners.startScanning();
    if (l != null) {
      AgentEvent ev = new AgentEvent(AgentEvent.CHANGED_AGENT_PRINCIPAL, agentID, from, to, myID());
      Iterator it = l.iterator();
      while (it.hasNext()) {
        AgentListener al = (AgentListener) it.next();
        al.changedAgentPrincipal(ev);
      }
      agentListeners.stopScanning();
    }
  }
View Full Code Here


    // NOTE: A normal synchronized block could create deadlock problems
    // as it prevents concurrent scannings of the listeners list.
    List l = agentListeners.startScanning();
    if (l != null) {
      AgentEvent ev = new AgentEvent(AgentEvent.CHANGED_AGENT_STATE, agentID, from, to, myID());
      Iterator it = l.iterator();
      while (it.hasNext()) {
        AgentListener al = (AgentListener) it.next();
        al.changedAgentState(ev);
      }
      agentListeners.stopScanning();
    }
  }
View Full Code Here

    // NOTE: A normal synchronized block could create deadlock problems
    // as it prevents concurrent scannings of the listeners list.
    List l = containerListeners.startScanning();
    if (l != null) {
      ContainerEvent ev = new ContainerEvent(ContainerEvent.BORN_AGENT, agentID, myID());
      Iterator it = l.iterator();
      while (it.hasNext()) {
        ContainerListener cl = (ContainerListener) it.next();
        cl.bornAgent(ev);
      }
      containerListeners.stopScanning();
    }
  }
View Full Code Here

    // NOTE: A normal synchronized block could create deadlock problems
    // as it prevents concurrent scannings of the listeners list.
    List l = containerListeners.startScanning();
    if (l != null) {
      ContainerEvent ev = new ContainerEvent(ContainerEvent.DEAD_AGENT, agentID, myID());
      Iterator it = l.iterator();
      while (it.hasNext()) {
        ContainerListener cl = (ContainerListener) it.next();
        cl.deadAgent(ev);
      }
      containerListeners.stopScanning();
    }
  }
View Full Code Here

    // NOTE: A normal synchronized block could create deadlock problems
    // as it prevents concurrent scannings of the listeners list.
    List l = containerListeners.startScanning();
    if (l != null) {
      ContainerEvent ev = new ContainerEvent(ContainerEvent.REATTACHED, null, myID());
      Iterator it = l.iterator();
      while (it.hasNext()) {
        ContainerListener cl = (ContainerListener) it.next();
        cl.reattached(ev);
      }
      containerListeners.stopScanning();
    }
  }
View Full Code Here

    // NOTE: A normal synchronized block could create deadlock problems
    // as it prevents concurrent scannings of the listeners list.
    List l = containerListeners.startScanning();
    if (l != null) {
      ContainerEvent ev = new ContainerEvent(ContainerEvent.RECONNECTED, null, myID());
      Iterator it = l.iterator();
      while (it.hasNext()) {
        ContainerListener cl = (ContainerListener) it.next();
        cl.reconnected(ev);
      }
      containerListeners.stopScanning();
    }
  }
View Full Code Here

    // NOTE: A normal synchronized block could create deadlock problems
    // as it prevents concurrent scannings of the listeners list.
    List l = containerListeners.startScanning();
    if (l != null) {
      ContainerEvent ev = new ContainerEvent(ContainerEvent.LEADERSHIP_ACQUIRED, null, myID());
      Iterator it = l.iterator();
      while (it.hasNext()) {
        ContainerListener cl = (ContainerListener) it.next();
        cl.leadershipAcquired(ev);
      }
      containerListeners.stopScanning();
    }
  }
View Full Code Here

    ToolNotifier tn = null;
    // Note that if a ToolNotifier exists it must be among the messageListeners
    // --> There is no need to search it also among the agentListeners.
    List l = messageListeners.startScanning();
    if (l != null) {
      Iterator it = l.iterator();
      while(it.hasNext()) {
        Object obj = it.next();
        if(obj instanceof ToolNotifier) {
          ToolNotifier tni = (ToolNotifier) obj;
          AID id = tni.getObserver();
          if(id.equals(observerName)) {
            tn = tni;
View Full Code Here

      List targets = (List)params[1];
     
      MainContainer impl = myContainer.getMain();
      if(impl != null) {   
        // Activate sniffing each element of the list
        Iterator it = targets.iterator();
        while(it.hasNext()) {
          AID target = (AID)it.next();
          ContainerID cid = impl.getContainerID(target);
         
          NotificationSlice slice = (NotificationSlice)getSlice(cid.getName());
          try {
            slice.sniffOn(sniffer, target);
View Full Code Here

      List targets = (List)params[1];
     
      MainContainer impl = myContainer.getMain();
      if(impl != null) {
        // Deactivate sniffing each element of the list
        Iterator it = targets.iterator();
        while(it.hasNext()) {
          AID target = (AID)it.next();
          ContainerID cid = impl.getContainerID(target);
         
          NotificationSlice slice = (NotificationSlice)getSlice(cid.getName());
          try {
            slice.sniffOff(sniffer, target);
View Full Code Here

TOP

Related Classes of jade.util.leap.Iterator

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.