Package org.zkoss.zk.ui.impl

## Class RequestQueueImpl

- java.lang.Object
- - org.zkoss.zk.ui.impl.RequestQueueImpl

- All Implemented Interfaces:
    `RequestQueue`

      public class RequestQueueImpl
      extends java.lang.Object
      implements RequestQueue

  An implementation of `RequestQueue` behaving as a queue of `AuRequest`. There is one queue for each desktop.

  Implementation Note: Unlike only of desktop members, this class must be thread-safe.

  Author:
    tomyeh

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `RequestQueueImpl()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addPerfRequestId​(java.lang.String requestId)` | Adds a request ID that uniquely identifies a request for performance measurement `PerformanceMeter`.
    `void` | `addRequests​(java.util.Collection<AuRequest> requests)` | Adds a list of requests to the queue.
    `java.util.Collection<java.lang.String>` | `clearPerfRequestIds()` | Clears all request IDs that were added by `RequestQueue.addPerfRequestId(java.lang.String)` for performance measurement.
    `boolean` | `isEmpty()` | Returns if no more request available in the queue.
    `AuRequest` | `nextRequest()` | Returns the next request, or null if no more request.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RequestQueueImpl

          public RequestQueueImpl()

  - ### Method Detail

    - #### addPerfRequestId

          public void addPerfRequestId​(java.lang.String requestId)

      Description copied from interface: `RequestQueue`
      Adds a request ID that uniquely identifies a request for performance measurement `PerformanceMeter`.
      Specified by:
        `addPerfRequestId` in interface `RequestQueue`
      Parameters:
        `requestId` - the request ID (never null)

    - #### clearPerfRequestIds

          public java.util.Collection<java.lang.String> clearPerfRequestIds()

      Description copied from interface: `RequestQueue`
      Clears all request IDs that were added by `RequestQueue.addPerfRequestId(java.lang.String)` for performance measurement. It is usually called after all requests are processed (`RequestQueue.isEmpty()` is true).
      Specified by:
        `clearPerfRequestIds` in interface `RequestQueue`
      Returns:
        a list of request IDs that were added by `RequestQueue.addPerfRequestId(java.lang.String)`, or null if no request ID was added.

    - #### isEmpty

          public boolean isEmpty()

      Description copied from interface: `RequestQueue`
      Returns if no more request available in the queue.
      Specified by:
        `isEmpty` in interface `RequestQueue`
      Returns:
        whether no more request is available in the queue.

    - #### nextRequest

          public AuRequest nextRequest()

      Description copied from interface: `RequestQueue`
      Returns the next request, or null if no more request. Once returned, the request is removed from the queue.
      Specified by:
        `nextRequest` in interface `RequestQueue`

    - #### addRequests

          public void addRequests​(java.util.Collection<AuRequest> requests)

      Description copied from interface: `RequestQueue`
      Adds a list of requests to the queue. Notice that when the request is added, it will be activated first, i.e., `AuRequest.activate()` will be called before adding to queue. If the component is not found or does not belong to the current execution, it will be ignored.
      Specified by:
        `addRequests` in interface `RequestQueue`