Class AsyncResult<V>
java.lang.Object
org.springframework.scheduling.annotation.AsyncResult<V>
- Type Parameters:
- V- the value type
- All Implemented Interfaces:
- Future<V>,- ListenableFuture<V>
Deprecated.
A pass-through 
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.
 
As of Spring 4.2, this class also supports passing execution exceptions back to the caller.
- Since:
- 3.0
- Author:
- Juergen Hoeller, Rossen Stoyanchev
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddCallback(ListenableFutureCallback<? super V> callback) Deprecated.Register the givenListenableFutureCallback.voidaddCallback(SuccessCallback<? super V> successCallback, FailureCallback failureCallback) Deprecated.Java 8 lambda-friendly alternative with success and failure callbacks.booleancancel(boolean mayInterruptIfRunning) Deprecated.Deprecated.Expose thisListenableFutureas a JDKCompletableFuture.static <V> ListenableFuture<V>Deprecated.Create a new async result which exposes the given exception as anExecutionExceptionfromFuture.get().static <V> ListenableFuture<V>forValue(V value) Deprecated.Create a new async result which exposes the given value fromFuture.get().get()Deprecated.Deprecated.booleanDeprecated.booleanisDone()Deprecated.
- 
Constructor Details- 
AsyncResultDeprecated.Create a new AsyncResult holder.- Parameters:
- value- the value to pass through
 
 
- 
- 
Method Details- 
cancelpublic boolean cancel(boolean mayInterruptIfRunning) Deprecated.
- 
isCancelledpublic boolean isCancelled()Deprecated.- Specified by:
- isCancelledin interface- Future<V>
 
- 
isDonepublic boolean isDone()Deprecated.
- 
getDeprecated.- Specified by:
- getin interface- Future<V>
- Throws:
- ExecutionException
 
- 
getDeprecated.- Specified by:
- getin interface- Future<V>
- Throws:
- ExecutionException
 
- 
addCallbackDeprecated.Description copied from interface:ListenableFutureRegister the givenListenableFutureCallback.- Specified by:
- addCallbackin interface- ListenableFuture<V>
- Parameters:
- callback- the callback to register
 
- 
addCallbackpublic void addCallback(SuccessCallback<? super V> successCallback, FailureCallback failureCallback) Deprecated.Description copied from interface:ListenableFutureJava 8 lambda-friendly alternative with success and failure callbacks.- Specified by:
- addCallbackin interface- ListenableFuture<V>
- Parameters:
- successCallback- the success callback
- failureCallback- the failure callback
 
- 
completableDeprecated.Description copied from interface:ListenableFutureExpose thisListenableFutureas a JDKCompletableFuture.- Specified by:
- completablein interface- ListenableFuture<V>
 
- 
forValueDeprecated.Create a new async result which exposes the given value fromFuture.get().- Parameters:
- value- the value to expose
- Since:
- 4.2
- See Also:
 
- 
forExecutionExceptionDeprecated.Create a new async result which exposes the given exception as anExecutionExceptionfromFuture.get().- Parameters:
- ex- the exception to expose (either an pre-built- ExecutionExceptionor a cause to be wrapped in an- ExecutionException)
- Since:
- 4.2
- See Also:
 
 
- 
CompletableFuture