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>
InterruptedException
ExecutionException
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<T>
InterruptedException
ExecutionException
TimeoutException
public boolean completed(T result)
public boolean failed(Exception exception)
public boolean cancel(boolean mayInterruptIfRunning)
public boolean cancel()
cancel
in interface Cancellable
Copyright © 2005-2015 The Apache Software Foundation. All Rights Reserved.