Class CompletableToListenableFutureAdapter<T>
java.lang.Object
org.springframework.util.concurrent.CompletableToListenableFutureAdapter<T>
- Type Parameters:
T
- the result type returned by this Future'sget
method
- All Implemented Interfaces:
Future<T>
,ListenableFuture<T>
- Direct Known Subclasses:
MonoToListenableFutureAdapter
@Deprecated(since="6.0")
public class CompletableToListenableFutureAdapter<T>
extends Object
implements ListenableFuture<T>
Deprecated.
as of 6.0, with no concrete replacement
- Since:
- 4.2
- Author:
- Sebastien Deleuze, Juergen Hoeller
-
Constructor Summary
ConstructorDescriptionCompletableToListenableFutureAdapter
(CompletableFuture<T> completableFuture) Deprecated.Create a new adapter for the givenCompletableFuture
.CompletableToListenableFutureAdapter
(CompletionStage<T> completionStage) Deprecated.Create a new adapter for the givenCompletionStage
. -
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.boolean
cancel
(boolean mayInterruptIfRunning) Deprecated.Deprecated.Expose thisListenableFuture
as a JDKCompletableFuture
.get()
Deprecated.Deprecated.boolean
Deprecated.boolean
isDone()
Deprecated.
-
Constructor Details
-
CompletableToListenableFutureAdapter
Deprecated.Create a new adapter for the givenCompletionStage
.- Since:
- 4.3.7
-
CompletableToListenableFutureAdapter
Deprecated.Create a new adapter for the givenCompletableFuture
.
-
-
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>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) Deprecated. -
isCancelled
public boolean isCancelled()Deprecated.- Specified by:
isCancelled
in interfaceFuture<T>
-
isDone
public boolean isDone()Deprecated. -
get
Deprecated.- Specified by:
get
in interfaceFuture<T>
- Throws:
InterruptedException
ExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Deprecated.- Specified by:
get
in interfaceFuture<T>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-