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'sget
method
- All Implemented Interfaces:
Runnable
,Future<T>
,RunnableFuture<T>
,ListenableFuture<T>
@Deprecated(since="6.0")
public class ListenableFutureTask<T>
extends FutureTask<T>
implements ListenableFuture<T>
Deprecated.
as of 6.0, with no concrete replacement
Extension of
FutureTask
that implements ListenableFuture
.- Since:
- 4.0
- Author:
- Arjen Poutsma
-
Constructor Summary
ConstructorDescriptionListenableFutureTask
(Runnable runnable, T result) Deprecated.Create aListenableFutureTask
that will, upon running, execute the givenRunnable
, and arrange thatFutureTask.get()
will return the given result on successful completion.ListenableFutureTask
(Callable<T> callable) Deprecated.Create a newListenableFutureTask
that will, upon running, execute the givenCallable
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCallback
(ListenableFutureCallback<? super T> callback) Deprecated.Register the givenListenableFutureCallback
.void
addCallback
(SuccessCallback<? super T> successCallback, FailureCallback failureCallback) Deprecated.Java 8 lambda-friendly alternative with success and failure callbacks.Deprecated.Expose thisListenableFuture
as a JDKCompletableFuture
.protected void
done()
Deprecated.Methods inherited from class java.util.concurrent.FutureTask
cancel, get, get, isCancelled, isDone, run, runAndReset, set, setException, toString
-
Constructor Details
-
ListenableFutureTask
Deprecated.Create a newListenableFutureTask
that will, upon running, execute the givenCallable
.- Parameters:
callable
- the callable task
-
ListenableFutureTask
Deprecated.Create aListenableFutureTask
that 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.Description copied from interface:ListenableFuture
Register the givenListenableFutureCallback
.- Specified by:
addCallback
in interfaceListenableFuture<T>
- Parameters:
callback
- the callback to register
-
addCallback
public void addCallback(SuccessCallback<? super T> successCallback, FailureCallback failureCallback) Deprecated.Description copied from interface:ListenableFuture
Java 8 lambda-friendly alternative with success and failure callbacks.- Specified by:
addCallback
in interfaceListenableFuture<T>
- Parameters:
successCallback
- the success callbackfailureCallback
- the failure callback
-
completable
Deprecated.Description copied from interface:ListenableFuture
Expose thisListenableFuture
as a JDKCompletableFuture
.- Specified by:
completable
in interfaceListenableFuture<T>
-
done
protected void done()Deprecated.- Overrides:
done
in classFutureTask<T>
-