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 ofRequestQueue
behaving as a queue ofAuRequest
. 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 measurementPerformanceMeter
.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 byRequestQueue.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.
-
-
-
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 measurementPerformanceMeter
.- Specified by:
addPerfRequestId
in interfaceRequestQueue
- 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 byRequestQueue.addPerfRequestId(java.lang.String)
for performance measurement. It is usually called after all requests are processed (RequestQueue.isEmpty()
is true).- Specified by:
clearPerfRequestIds
in interfaceRequestQueue
- 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 interfaceRequestQueue
- 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 interfaceRequestQueue
-
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 interfaceRequestQueue
-
-