Class TimeoutListenableFuture<V>
- java.lang.Object
-
- com.google.common.collect.ForwardingObject
-
- com.google.common.util.concurrent.ForwardingFuture<V>
-
- com.google.common.util.concurrent.ForwardingListenableFuture<V>
-
- com.github.phantomthief.concurrent.TimeoutListenableFuture<V>
-
- All Implemented Interfaces:
com.google.common.util.concurrent.ListenableFuture<V>,Future<V>
public class TimeoutListenableFuture<V> extends com.google.common.util.concurrent.ForwardingListenableFuture<V>- Author:
- w.vela Created on 16/5/31.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.util.concurrent.ForwardingListenableFuture
com.google.common.util.concurrent.ForwardingListenableFuture.SimpleForwardingListenableFuture<V extends Object>
-
Nested classes/interfaces inherited from class com.google.common.util.concurrent.ForwardingFuture
com.google.common.util.concurrent.ForwardingFuture.SimpleForwardingFuture<V extends Object>
-
-
Constructor Summary
Constructors Constructor Description TimeoutListenableFuture(com.google.common.util.concurrent.ListenableFuture<V> delegate)better usetimeoutListenableFuture(ListenableFuture)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeoutListenableFuture<V>addTimeoutListener(ThrowableConsumer<TimeoutException,Exception> listener)TimeoutListenableFuture<V>addTimeoutListener(ThrowableRunnable<Exception> listener)protected com.google.common.util.concurrent.ListenableFuture<V>delegate()Vget(long timeout, TimeUnit unit)List<ThrowableConsumer<TimeoutException,Exception>>getTimeoutListeners()static <V> TimeoutListenableFuture<V>timeoutListenableFuture(com.google.common.util.concurrent.ListenableFuture<V> delegate)-
Methods inherited from class com.google.common.util.concurrent.ForwardingListenableFuture
addListener
-
Methods inherited from class com.google.common.util.concurrent.ForwardingFuture
cancel, get, isCancelled, isDone
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.Future
cancel, get, isCancelled, isDone
-
-
-
-
Constructor Detail
-
TimeoutListenableFuture
public TimeoutListenableFuture(com.google.common.util.concurrent.ListenableFuture<V> delegate)
better usetimeoutListenableFuture(ListenableFuture)
-
-
Method Detail
-
timeoutListenableFuture
public static <V> TimeoutListenableFuture<V> timeoutListenableFuture(com.google.common.util.concurrent.ListenableFuture<V> delegate)
-
delegate
protected com.google.common.util.concurrent.ListenableFuture<V> delegate()
- Specified by:
delegatein classcom.google.common.util.concurrent.ForwardingListenableFuture<V>
-
addTimeoutListener
public TimeoutListenableFuture<V> addTimeoutListener(@Nonnull ThrowableRunnable<Exception> listener)
-
addTimeoutListener
public TimeoutListenableFuture<V> addTimeoutListener(@Nonnull ThrowableConsumer<TimeoutException,Exception> listener)
-
get
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
getin interfaceFuture<V>- Overrides:
getin classcom.google.common.util.concurrent.ForwardingFuture<V>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
getTimeoutListeners
public List<ThrowableConsumer<TimeoutException,Exception>> getTimeoutListeners()
-
-