Class ThrottleLimitResultQueue<T>
- java.lang.Object
- org.springframework.batch.repeat.support.ThrottleLimitResultQueue<T>
public class ThrottleLimitResultQueue<T> extends java.lang.Object
An implementation of theResultQueue
that throttles the number of expected results, limiting it to a maximum at any given time.- Author:
- Dave Syer
Constructor Summary
Constructors Constructor Description ThrottleLimitResultQueue(int throttleLimit)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
expect()
Tell the queue to expect one more result.boolean
isEmpty()
boolean
isExpecting()
void
put(T holder)
T
take()
Method Detail
isEmpty
public boolean isEmpty()
isExpecting
public boolean isExpecting()
expect
public void expect() throws java.lang.InterruptedException
Tell the queue to expect one more result. Blocks until a new result is available if already expecting too many (as determined by the throttle limit).- Throws:
java.lang.InterruptedException
- See Also:
ResultQueue.expect()
put
public void put(T holder) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
take
public T take() throws java.util.NoSuchElementException, java.lang.InterruptedException
- Throws:
java.util.NoSuchElementException
java.lang.InterruptedException