public class GuavaListenableFutureAdapter<T> extends Object implements org.springframework.util.concurrent.ListenableFuture<T>
ListenableFuture into a Spring
ListenableFuture.| Constructor and Description |
|---|
GuavaListenableFutureAdapter(com.google.common.util.concurrent.ListenableFuture<T> adaptee,
org.springframework.dao.support.PersistenceExceptionTranslator persistenceExceptionTranslator)
Create a new
GuavaListenableFutureAdapter given a Guava
ListenableFuture and a PersistenceExceptionTranslator. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCallback(org.springframework.util.concurrent.ListenableFutureCallback<? super T> callback) |
void |
addCallback(org.springframework.util.concurrent.SuccessCallback<? super T> successCallback,
org.springframework.util.concurrent.FailureCallback failureCallback) |
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
public GuavaListenableFutureAdapter(com.google.common.util.concurrent.ListenableFuture<T> adaptee, org.springframework.dao.support.PersistenceExceptionTranslator persistenceExceptionTranslator)
GuavaListenableFutureAdapter given a Guava
ListenableFuture and a PersistenceExceptionTranslator.adaptee - must not be null.persistenceExceptionTranslator - must not be null.public void addCallback(org.springframework.util.concurrent.ListenableFutureCallback<? super T> callback)
addCallback in interface org.springframework.util.concurrent.ListenableFuture<T>public void addCallback(org.springframework.util.concurrent.SuccessCallback<? super T> successCallback, org.springframework.util.concurrent.FailureCallback failureCallback)
addCallback in interface org.springframework.util.concurrent.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–2017 Pivotal Software, Inc.. All rights reserved.