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, waitMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Constructor Details
-
BasicFuture
-
-
Method Details
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<T>
-
isDone
public boolean isDone() -
get
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
completed
-
failed
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
cancel
public boolean cancel()- Specified by:
cancelin interfaceCancellable
-