Class ListenableFutureTask<T>
java.lang.Object
java.util.concurrent.FutureTask<T>
org.springframework.util.concurrent.ListenableFutureTask<T>
- Type Parameters:
T- the result type returned by this Future'sgetmethod
- All Implemented Interfaces:
Runnable,Future<T>,RunnableFuture<T>,ListenableFuture<T>
@Deprecated(since="6.0",
forRemoval=true)
public class ListenableFutureTask<T>
extends FutureTask<T>
implements ListenableFuture<T>
Deprecated, for removal: This API element is subject to removal in a future version.
as of 6.0, with no concrete replacement
Extension of
FutureTask that implements ListenableFuture.- Since:
- 4.0
- Author:
- Arjen Poutsma
-
Constructor Summary
ConstructorsConstructorDescriptionListenableFutureTask(Runnable runnable, T result) Deprecated, for removal: This API element is subject to removal in a future version.Create aListenableFutureTaskthat will, upon running, execute the givenRunnable, and arrange thatFutureTask.get()will return the given result on successful completion.ListenableFutureTask(Callable<T> callable) Deprecated, for removal: This API element is subject to removal in a future version.Create a newListenableFutureTaskthat will, upon running, execute the givenCallable. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCallback(ListenableFutureCallback<? super T> callback) Deprecated, for removal: This API element is subject to removal in a future version.Register the givenListenableFutureCallback.voidaddCallback(SuccessCallback<? super T> successCallback, FailureCallback failureCallback) Deprecated, for removal: This API element is subject to removal in a future version.Java 8 lambda-friendly alternative with success and failure callbacks.Deprecated, for removal: This API element is subject to removal in a future version.Expose thisListenableFutureas a JDKCompletableFuture.protected voiddone()Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class java.util.concurrent.FutureTask
cancel, get, get, isCancelled, isDone, run, runAndReset, set, setException, toString
-
Constructor Details
-
ListenableFutureTask
Deprecated, for removal: This API element is subject to removal in a future version.Create a newListenableFutureTaskthat will, upon running, execute the givenCallable.- Parameters:
callable- the callable task
-
ListenableFutureTask
Deprecated, for removal: This API element is subject to removal in a future version.Create aListenableFutureTaskthat will, upon running, execute the givenRunnable, and arrange thatFutureTask.get()will return the given result on successful completion.- Parameters:
runnable- the runnable taskresult- the result to return on successful completion
-
-
Method Details
-
addCallback
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ListenableFutureRegister the givenListenableFutureCallback.- Specified by:
addCallbackin interfaceListenableFuture<T>- Parameters:
callback- the callback to register
-
addCallback
public void addCallback(SuccessCallback<? super T> successCallback, FailureCallback failureCallback) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ListenableFutureJava 8 lambda-friendly alternative with success and failure callbacks.- Specified by:
addCallbackin interfaceListenableFuture<T>- Parameters:
successCallback- the success callbackfailureCallback- the failure callback
-
completable
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ListenableFutureExpose thisListenableFutureas a JDKCompletableFuture.- Specified by:
completablein interfaceListenableFuture<T>
-
done
protected void done()Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
donein classFutureTask<T>
-