Package org.apache.http.concurrent
Class BasicFuture<T>
java.lang.Object
org.apache.http.concurrent.BasicFuture<T>
- Type Parameters:
T
- the future result type of an asynchronous operation.
- All Implemented Interfaces:
Future<T>
,Cancellable
Basic implementation of the
Future
interface. BasicFuture
can be put into a completed state by invoking any of the following methods:
cancel()
, failed(Exception)
, or completed(Object)
.- Since:
- 4.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Constructor Details
-
BasicFuture
-
-
Method Details
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<T>
-
isDone
public boolean isDone() -
get
- Specified by:
get
in interfaceFuture<T>
- Throws:
InterruptedException
ExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
get
in interfaceFuture<T>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
completed
-
failed
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
cancel
public boolean cancel()- Specified by:
cancel
in interfaceCancellable
-