T - the future result type of an asynchronous operation.public class BasicFuture<T> extends Object implements Future<T>, Cancellable
Future interface. BasicFuture
can be put into a completed state by invoking any of the following methods:
cancel(), failed(Exception), or completed(Object).| Constructor and Description |
|---|
BasicFuture(FutureCallback<T> callback) |
public BasicFuture(FutureCallback<T> callback)
public boolean isCancelled()
isCancelled in interface Future<T>public T get() throws InterruptedException, ExecutionException
get in interface Future<T>InterruptedExceptionExecutionExceptionpublic T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<T>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic boolean completed(T result)
public boolean failed(Exception exception)
public boolean cancel(boolean mayInterruptIfRunning)
public boolean cancel()
cancel in interface CancellableCopyright © 2005–2013 The Apache Software Foundation. All rights reserved.