Class FairBlockingQueue.ExchangeCountDownLatch<T>
java.lang.Object
java.util.concurrent.CountDownLatch
org.apache.tomcat.jdbc.pool.FairBlockingQueue.ExchangeCountDownLatch<T>
- Type Parameters:
T- the type of the item to exchange
- Enclosing class:
FairBlockingQueue<E>
A count down latch that can be used to exchange information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FairBlockingQueue<E>.ItemFuture<T> The future the item is exchanged with, set byFairBlockingQueue.pollAsync()and null for the waiters ofFairBlockingQueue.poll(long, TimeUnit).protected TThe item to exchange. -
Constructor Summary
ConstructorsConstructorDescriptionExchangeCountDownLatch(int i) Creates a new ExchangeCountDownLatch with the given count. -
Method Summary
Modifier and TypeMethodDescriptionReturns the future the exchanged item is meant for.getItem()Returns the exchanged item.voidsetFuture(FairBlockingQueue<E>.ItemFuture<T> future) Sets the future the exchanged item is meant for.voidSets the item to be exchanged.
-
Field Details
-
item
The item to exchange. -
future
The future the item is exchanged with, set byFairBlockingQueue.pollAsync()and null for the waiters ofFairBlockingQueue.poll(long, TimeUnit).
-
-
Constructor Details
-
ExchangeCountDownLatch
public ExchangeCountDownLatch(int i) Creates a new ExchangeCountDownLatch with the given count.- Parameters:
i- the count
-
-
Method Details
-
getItem
-
setItem
-
getFuture
Returns the future the exchanged item is meant for.- Returns:
- the future of an asynchronous poll, or null
-
setFuture
Sets the future the exchanged item is meant for.- Parameters:
future- the future of an asynchronous poll
-