类 ResultHolderResultQueue
- java.lang.Object
- org.springframework.batch.repeat.support.ResultHolderResultQueue
public class ResultHolderResultQueue extends java.lang.Object
An implementation of theResultQueue
that throttles the number of expected results, limiting it to a maximum at any given time.- 作者:
- Dave Syer
构造器概要
构造器 构造器 说明 ResultHolderResultQueue(int throttleLimit)
构造器详细资料
ResultHolderResultQueue
public ResultHolderResultQueue(int throttleLimit)
- 参数:
throttleLimit
- the maximum number of results that can be expected at any given time.
方法详细资料
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).- 抛出:
java.lang.InterruptedException
- 另请参阅:
ResultQueue.expect()
put
public void put(org.springframework.batch.repeat.support.ResultHolder holder) throws java.lang.IllegalArgumentException
- 抛出:
java.lang.IllegalArgumentException
take
public org.springframework.batch.repeat.support.ResultHolder take() throws java.util.NoSuchElementException, java.lang.InterruptedException
Get the next result as soon as it becomes available.
Release result immediately if:- There is a result that is continuable.
- There is no result (as per contract of
ResultQueue
). - The number of results is less than the number expected.
- Not expecting.
- Interrupted.
- 抛出:
java.util.NoSuchElementException
java.lang.InterruptedException
- 另请参阅:
ResultQueue.take()