Package jade.util.leap

Examples of jade.util.leap.List


  }
 
  private void fireChangedAgentState(AID agentID, AgentState from, AgentState to) {
    // 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


  }
 
  private void fireBornAgent(AID agentID) {
    // 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

  }
 
  private void fireDeadAgent(AID agentID) {
    // 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

  }
 
  private void fireReattached() {
    // 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

  }
 
  private void fireReconnected() {
    // 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

  }
 
  private void fireLeadershipAcquired() {
    // 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

  ////////////////////////////
  private ToolNotifier findNotifier(AID observerName) {
    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();
View Full Code Here

    }
       
    private void handleSniffOn(VerticalCommand cmd) throws IMTPException, ServiceException, NotFoundException {
      Object[] params = cmd.getParams();
      AID sniffer = (AID)params[0];
      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());
View Full Code Here

    }
   
    private void handleSniffOff(VerticalCommand cmd) throws IMTPException, ServiceException, NotFoundException {
      Object[] params = cmd.getParams();
      AID sniffer = (AID)params[0];
      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());
View Full Code Here

    }
   
    private void handleDebugOn(VerticalCommand cmd) throws IMTPException, ServiceException, NotFoundException {
      Object[] params = cmd.getParams();
      AID introspector = (AID)params[0];
      List targets = (List)params[1];
     
      MainContainer impl = myContainer.getMain();
      if(impl != null) {
        // Activate debugging 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());
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.