public class AsyncResult<V> extends Object implements org.springframework.util.concurrent.ListenableFuture<V>
Future
handle that can be used for method signatures
which are declared with a Future
return type for asynchronous execution.
As of Spring 4.1, this class implements ListenableFuture
, not just
plain Future
, along with the corresponding support
in @Async
processing.
Async
Constructor and Description |
---|
AsyncResult(V value)
Create a new AsyncResult holder.
|
Modifier and Type | Method and Description |
---|---|
void |
addCallback(org.springframework.util.concurrent.ListenableFutureCallback<? super V> callback) |
void |
addCallback(org.springframework.util.concurrent.SuccessCallback<? super V> successCallback,
org.springframework.util.concurrent.FailureCallback failureCallback) |
boolean |
cancel(boolean mayInterruptIfRunning) |
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
public AsyncResult(V value)
value
- the value to pass throughpublic boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<V>
public void addCallback(org.springframework.util.concurrent.ListenableFutureCallback<? super V> callback)
addCallback
in interface org.springframework.util.concurrent.ListenableFuture<V>