public class FlowControllingBlockingQueue<T> extends Object
This implementation is only safe where we have a single thread adding items and a single (different) thread removing items.
TODO Make this implement java.util.Queue and hide the implementation. Then different queue types can be substituted.
| Modifier and Type | Class and Description |
|---|---|
static interface |
FlowControllingBlockingQueue.ThresholdListener |
| Constructor and Description |
|---|
FlowControllingBlockingQueue(int threshold,
FlowControllingBlockingQueue.ThresholdListener listener) |
FlowControllingBlockingQueue(int highThreshold,
int lowThreshold,
FlowControllingBlockingQueue.ThresholdListener listener) |
public FlowControllingBlockingQueue(int threshold,
FlowControllingBlockingQueue.ThresholdListener listener)
public FlowControllingBlockingQueue(int highThreshold,
int lowThreshold,
FlowControllingBlockingQueue.ThresholdListener listener)
public boolean isEmpty()
public void close()
public T blockingPeek() throws InterruptedException
InterruptedExceptionpublic T nonBlockingTake() throws InterruptedException
InterruptedExceptionpublic T take() throws InterruptedException
InterruptedExceptionpublic void add(T o)
public boolean remove(T o)
public void clear()
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.