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",
forRemoval=true)
public class CompletableToListenableFutureAdapter<T>
extends Object
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
- Since:
- 4.2
- Author:
- Sebastien Deleuze, Juergen Hoeller
-
Constructor Summary
ConstructorsConstructorDescriptionCompletableToListenableFutureAdapter(CompletableFuture<T> completableFuture) Deprecated, for removal: This API element is subject to removal in a future version.Create a new adapter for the givenCompletableFuture.CompletableToListenableFutureAdapter(CompletionStage<T> completionStage) Deprecated, for removal: This API element is subject to removal in a future version.Create a new adapter for the givenCompletionStage. -
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.booleancancel(boolean mayInterruptIfRunning) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Expose thisListenableFutureas a JDKCompletableFuture.get()Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanisDone()Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
CompletableToListenableFutureAdapter
Deprecated, for removal: This API element is subject to removal in a future version.Create a new adapter for the givenCompletionStage.- Since:
- 4.3.7
-
CompletableToListenableFutureAdapter
Deprecated, for removal: This API element is subject to removal in a future version.Create a new adapter for the givenCompletableFuture.
-
-
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>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) Deprecated, for removal: This API element is subject to removal in a future version. -
isCancelled
public boolean isCancelled()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
isCancelledin interfaceFuture<T>
-
isDone
public boolean isDone()Deprecated, for removal: This API element is subject to removal in a future version. -
get
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-