Class FairBlockingQueue.ItemFuture<T>

java.lang.Object
org.apache.tomcat.jdbc.pool.FairBlockingQueue.ItemFuture<T>
Type Parameters:
T - the type of the item
All Implemented Interfaces:
Future<T>
Enclosing class:
FairBlockingQueue<E>

protected class FairBlockingQueue.ItemFuture<T> extends Object implements Future<T>
A future used to check if a connection has been made available. Cancelling the future deregisters its waiter from the queue, as long as the item has not already been handed over to the future.
A get(long, TimeUnit) call that times out deregisters the waiter in the same way, and additionally fails the future terminally: no offer can reach the deregistered latch anymore, so the future reports isDone() true without ever being cancelled, keeps failing every later get(long, TimeUnit) with a TimeoutException and every later get() with an ExecutionException caused by one, and can no longer be cancelled.