Class CompletableToListenableFutureAdapter<T>
java.lang.Object
org.springframework.util.concurrent.CompletableToListenableFutureAdapter<T>
- Type Parameters:
T- the result type returned by this Future'sgetmethod
- 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
ConstructorsConstructorDescriptionCompletableToListenableFutureAdapter(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 TypeMethodDescriptionvoidaddCallback(ListenableFutureCallback<? super T> callback) Deprecated.Register the givenListenableFutureCallback.voidaddCallback(SuccessCallback<? super T> successCallback, FailureCallback failureCallback) Deprecated.Java 8 lambda-friendly alternative with success and failure callbacks.booleancancel(boolean mayInterruptIfRunning) Deprecated.Deprecated.Expose thisListenableFutureas a JDKCompletableFuture.get()Deprecated.Deprecated.booleanDeprecated.booleanisDone()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: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.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.Description copied from interface:ListenableFutureExpose thisListenableFutureas a JDKCompletableFuture.- Specified by:
completablein interfaceListenableFuture<T>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) Deprecated. -
isCancelled
public boolean isCancelled()Deprecated.- Specified by:
isCancelledin interfaceFuture<T>
-
isDone
public boolean isDone()Deprecated. -
get
Deprecated.- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Deprecated.- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-