T - the result type returned by this Future's get methodpublic class CassandraFutureAdapter<T> extends Object implements ListenableFuture<T>
CompletableFuture or CompletionStage into a Spring ListenableFuture applying
PersistenceExceptionTranslator.| Constructor and Description |
|---|
CassandraFutureAdapter(CompletableFuture<T> completableFuture,
PersistenceExceptionTranslator exceptionMapper)
Create a new adapter for the given
CompletableFuture. |
CassandraFutureAdapter(CompletionStage<T> completionStage,
PersistenceExceptionTranslator exceptionMapper)
Create a new adapter for the given
CompletionStage. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCallback(ListenableFutureCallback<? super T> callback) |
void |
addCallback(SuccessCallback<? super T> successCallback,
FailureCallback failureCallback) |
boolean |
cancel(boolean mayInterruptIfRunning) |
CompletableFuture<T> |
completable() |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
public CassandraFutureAdapter(CompletionStage<T> completionStage, PersistenceExceptionTranslator exceptionMapper)
CompletionStage.public CassandraFutureAdapter(CompletableFuture<T> completableFuture, PersistenceExceptionTranslator exceptionMapper)
CompletableFuture.public void addCallback(ListenableFutureCallback<? super T> callback)
addCallback in interface ListenableFuture<T>public void addCallback(SuccessCallback<? super T> successCallback, FailureCallback failureCallback)
addCallback in interface ListenableFuture<T>public CompletableFuture<T> completable()
completable in interface ListenableFuture<T>public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<T>public T get() throws InterruptedException, ExecutionException
get in interface Future<T>InterruptedExceptionExecutionExceptionpublic T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<T>InterruptedExceptionExecutionExceptionTimeoutExceptionCopyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.