Class ThrottleLimitResultQueue<T>
- java.lang.Object
- org.springframework.batch.repeat.support.ThrottleLimitResultQueue<T>
public class ThrottleLimitResultQueue<T> extends java.lang.ObjectAn implementation of theResultQueuethat 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 voidexpect()Tell the queue to expect one more result.booleanisEmpty()booleanisExpecting()voidput(T holder)Ttake()
Method Detail
isEmpty
public boolean isEmpty()
isExpecting
public boolean isExpecting()
expect
public void expect() throws java.lang.InterruptedExceptionTell 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.NoSuchElementExceptionjava.lang.InterruptedException