protected class FairBlockingQueue.ItemFuture<T>
extends java.lang.Object
implements java.util.concurrent.Future<T>
Modifier and Type | Field and Description |
---|---|
protected boolean |
canceled |
protected T |
item |
protected FairBlockingQueue.ExchangeCountDownLatch<T> |
latch |
Constructor and Description |
---|
ItemFuture(FairBlockingQueue.ExchangeCountDownLatch<T> latch) |
ItemFuture(T item) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
protected volatile T item
protected volatile FairBlockingQueue.ExchangeCountDownLatch<T> latch
protected volatile boolean canceled
public ItemFuture(T item)
public ItemFuture(FairBlockingQueue.ExchangeCountDownLatch<T> latch)
public boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface java.util.concurrent.Future<T>
public T get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<T>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public T get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get
in interface java.util.concurrent.Future<T>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<T>
public boolean isDone()
isDone
in interface java.util.concurrent.Future<T>
Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.