Package org.zkoss.zk.au

Examples of org.zkoss.zk.au.AuRequest


    }
    return false;
  }
  public AuRequest nextRequest() {
    while (!_requests.isEmpty()) {
      final AuRequest request = (AuRequest)_requests.remove(0);
      if (!isObsolete(request))
        return request;
    }
    return null;
  }
View Full Code Here


    }
    return null;
  }
  public void addRequests(Collection requests) {
    for (Iterator it = requests.iterator(); it.hasNext();) {
      final AuRequest request = (AuRequest)it.next();
      try {
        request.activate();
        if (!isObsolete(request))
          addRequest(request);
      } catch (ComponentNotFoundException ex) { //ignore it
        //ignore it since a long request might remove a timer
        //while clients already queues onTimer generated by the timer
View Full Code Here

      if (last < 0) { //optimize the most common case
        _requests.add(request);
        return;
      }

      final AuRequest req2 = (AuRequest)_requests.get(last);
      if ((req2.getOptions() & AuRequest.BUSY_IGNORE) != 0) {
        _requests.remove(last); //drop it
        if (last == 0) {
          _requests.add(request);
          return;
        }
      }
    }

    final String name = request.getCommand();
    final int opts = request.getOptions();

    //Since 3.0.2, redundant CTRL_GROUP is removed at the client

    //case 2, DUPLICATE_IGNORE: drop existent request if they are the same
    //as the arrival.
    if ((opts & AuRequest.DUPLICATE_IGNORE) != 0) {
      final String uuid = getUuid(request);
      for (Iterator it = _requests.iterator(); it.hasNext();) {
        final AuRequest req2 = (AuRequest)it.next();
        if (req2.getCommand().equals(name)
        && Objects.equals(getUuid(req2), uuid)) {
          it.remove(); //drop req2 (the old one)
          break; //no need to iterate because impossible to have more
        }
      }

    //Case 3, REPEAT_IGNORE: drop existent if the immediate
    //following is the same
    } else if ((opts & AuRequest.REPEAT_IGNORE) != 0) {
      final int last = _requests.size() - 1;
      final AuRequest req2 = (AuRequest)_requests.get(last);
      if (req2.getCommand().equals(name)
      && Objects.equals(getUuid(req2), getUuid(request))) {
        _requests.remove(last);
      }
    }
View Full Code Here

TOP

Related Classes of org.zkoss.zk.au.AuRequest

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.