Class ProcessingQueue<T>
java.lang.Object
org.jgroups.util.ProcessingQueue<T>
- Type Parameters:
T- T
A queue with many producers and consumers. However, only one consumer gets to remove and process elements
at any given time. This is done through the use of locks.
- Since:
- 3.5
- Author:
- Bela Ban
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ReentrantLockprotected intprotected ProcessingQueue.Handler<T> protected final ReentrantLock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetQueue()protected voidprocess()booleanretainAll(Collection<T> elements) setHandler(ProcessingQueue.Handler<T> handler) intsize()toString()
-
Field Details
-
queue
-
producer_lock
-
consumer_lock
-
count
protected int count -
handler
-
-
Constructor Details
-
ProcessingQueue
public ProcessingQueue()
-
-
Method Details
-
getQueue
-
size
public int size() -
setHandler
-
add
-
retainAll
-
toString
-
process
protected void process()
-