Uses of Interface
com.google.common.util.concurrent.ListenableFuture
-
Packages that use ListenableFuture Package Description com.google.common.cache This package contains caching utilities.com.google.common.util.concurrent Concurrency utilities. -
-
Uses of ListenableFuture in com.google.common.cache
Methods in com.google.common.cache that return ListenableFuture Modifier and Type Method Description ListenableFuture<V>CacheLoader. reload(K key, V oldValue)Computes or retrieves a replacement value corresponding to an already-cachedkey. -
Uses of ListenableFuture in com.google.common.util.concurrent
Subinterfaces of ListenableFuture in com.google.common.util.concurrent Modifier and Type Interface Description interfaceListenableScheduledFuture<V extends @Nullable java.lang.Object>Helper interface to implement bothListenableFutureandScheduledFuture.Classes in com.google.common.util.concurrent that implement ListenableFuture Modifier and Type Class Description classAbstractFuture<V extends @Nullable java.lang.Object>An abstract implementation ofListenableFuture, intended for advanced users only.classFluentFuture<V extends @Nullable java.lang.Object>AListenableFuturethat supports fluent chains of operations.classForwardingListenableFuture<V extends @Nullable java.lang.Object>AListenableFuturewhich forwards all its method calls to another future.static classForwardingListenableFuture.SimpleForwardingListenableFuture<V extends @Nullable java.lang.Object>A simplified version ofForwardingListenableFuturewhere subclasses can pass in an already constructedListenableFutureas the delegate.classListenableFutureTask<V extends @Nullable java.lang.Object>AFutureTaskthat also implements theListenableFutureinterface.classSettableFuture<V extends @Nullable java.lang.Object>AListenableFuturewhose result can be set by aSettableFuture.set(Object),SettableFuture.setException(Throwable)orSettableFuture.setFuture(ListenableFuture)call.Methods in com.google.common.util.concurrent that return ListenableFuture Modifier and Type Method Description static <V extends @Nullable java.lang.Object>
ListenableFuture<java.util.List<V>>Futures. allAsList(ListenableFuture<? extends V>... futures)Creates a newListenableFuturewhose value is a list containing the values of all its input futures, if all succeed.static <V extends @Nullable java.lang.Object>
ListenableFuture<java.util.List<V>>Futures. allAsList(java.lang.Iterable<? extends ListenableFuture<? extends V>> futures)Creates a newListenableFuturewhose value is a list containing the values of all its input futures, if all succeed.ListenableFuture<O>AsyncFunction. apply(I input)Returns an outputFutureto use in place of the giveninput.ListenableFuture<V>AsyncCallable. call()Computes a resultFuture.<C extends @Nullable java.lang.Object>
ListenableFuture<C>Futures.FutureCombiner. call(java.util.concurrent.Callable<C> combiner, java.util.concurrent.Executor executor)Creates theListenableFuturewhich will return the result of callingCallable.call()incombinerwhen all futures complete, using the specifiedexecutor.<C extends @Nullable java.lang.Object>
ListenableFuture<C>Futures.FutureCombiner. callAsync(AsyncCallable<C> combiner, java.util.concurrent.Executor executor)Creates theListenableFuturewhich will return the result of callingAsyncCallable.call()incombinerwhen all futures complete, using the specifiedexecutor.static <V extends @Nullable java.lang.Object,X extends java.lang.Throwable>
ListenableFuture<V>Futures. catching(ListenableFuture<? extends V> input, java.lang.Class<X> exceptionType, Function<? super X,? extends V> fallback, java.util.concurrent.Executor executor)Returns aFuturewhose result is taken from the given primaryinputor, if the primary input fails with the givenexceptionType, from the result provided by thefallback.static <V extends @Nullable java.lang.Object,X extends java.lang.Throwable>
ListenableFuture<V>Futures. catchingAsync(ListenableFuture<? extends V> input, java.lang.Class<X> exceptionType, AsyncFunction<? super X,? extends V> fallback, java.util.concurrent.Executor executor)Returns aFuturewhose result is taken from the given primaryinputor, if the primary input fails with the givenexceptionType, from the result provided by thefallback.protected abstract ListenableFuture<? extends V>ForwardingListenableFuture. delegate()protected ListenableFuture<V>ForwardingListenableFuture.SimpleForwardingListenableFuture. delegate()static <V extends @Nullable java.lang.Object>
ListenableFuture<V>Futures. immediateCancelledFuture()Creates aListenableFuturewhich is cancelled immediately upon construction, so thatisCancelled()always returnstrue.static <V extends @Nullable java.lang.Object>
ListenableFuture<V>Futures. immediateFailedFuture(java.lang.Throwable throwable)Returns aListenableFuturewhich has an exception set immediately upon construction.static <V extends @Nullable java.lang.Object>
ListenableFuture<V>Futures. immediateFuture(V value)Creates aListenableFuturewhich has its value set immediately upon construction.static ListenableFuture<@Nullable java.lang.Void>Futures. immediateVoidFuture()Returns a successfulListenableFuture<Void>.static <V extends @Nullable java.lang.Object>
ListenableFuture<V>JdkFutureAdapters. listenInPoolThread(java.util.concurrent.Future<V> future)Assigns a thread to the givenFutureto provideListenableFuturefunctionality.static <V extends @Nullable java.lang.Object>
ListenableFuture<V>JdkFutureAdapters. listenInPoolThread(java.util.concurrent.Future<V> future, java.util.concurrent.Executor executor)Submits a blocking task for the givenFutureto provideListenableFuturefunctionality.static <V extends @Nullable java.lang.Object>
ListenableFuture<V>Futures. nonCancellationPropagating(ListenableFuture<V> future)Returns aListenableFuturewhose result is set from the supplied future when it completes.ListenableFuture<?>Futures.FutureCombiner. run(java.lang.Runnable combiner, java.util.concurrent.Executor executor)Creates theListenableFuturewhich will return the result of runningcombinerwhen all Futures complete.static <O extends @Nullable java.lang.Object>
ListenableFuture<O>Futures. scheduleAsync(AsyncCallable<O> callable, long delay, java.util.concurrent.TimeUnit timeUnit, java.util.concurrent.ScheduledExecutorService executorService)Schedulescallableon the specifiedexecutor, returning aFuture.ListenableFuture<?>ClosingFuture. statusFuture()Returns a future that finishes when this step does.ListenableFuture<?>AbstractListeningExecutorService. submit(java.lang.Runnable task)<T extends @Nullable java.lang.Object>
ListenableFuture<T>AbstractListeningExecutorService. submit(java.lang.Runnable task, T result)<T extends @Nullable java.lang.Object>
ListenableFuture<T>AbstractListeningExecutorService. submit(java.util.concurrent.Callable<T> task)<T extends @Nullable java.lang.Object>
ListenableFuture<T>ExecutionSequencer. submit(java.util.concurrent.Callable<T> callable, java.util.concurrent.Executor executor)Enqueues a task to run when the previous task (if any) completes.ListenableFuture<?>ForwardingListeningExecutorService. submit(java.lang.Runnable task)<T extends @Nullable java.lang.Object>
ListenableFuture<T>ForwardingListeningExecutorService. submit(java.lang.Runnable task, T result)<T extends @Nullable java.lang.Object>
ListenableFuture<T>ForwardingListeningExecutorService. submit(java.util.concurrent.Callable<T> task)static ListenableFuture<@Nullable java.lang.Void>Futures. submit(java.lang.Runnable runnable, java.util.concurrent.Executor executor)Executesrunnableon the specifiedexecutor, returning aFuturethat will complete after execution.static <O extends @Nullable java.lang.Object>
ListenableFuture<O>Futures. submit(java.util.concurrent.Callable<O> callable, java.util.concurrent.Executor executor)Executescallableon the specifiedexecutor, returning aFuture.ListenableFuture<?>ListeningExecutorService. submit(java.lang.Runnable task)<T extends @Nullable java.lang.Object>
ListenableFuture<T>ListeningExecutorService. submit(java.lang.Runnable task, T result)<T extends @Nullable java.lang.Object>
ListenableFuture<T>ListeningExecutorService. submit(java.util.concurrent.Callable<T> task)<T extends @Nullable java.lang.Object>
ListenableFuture<T>ExecutionSequencer. submitAsync(AsyncCallable<T> callable, java.util.concurrent.Executor executor)Enqueues a task to run when the previous task (if any) completes.static <O extends @Nullable java.lang.Object>
ListenableFuture<O>Futures. submitAsync(AsyncCallable<O> callable, java.util.concurrent.Executor executor)Executescallableon the specifiedexecutor, returning aFuture.static <V extends @Nullable java.lang.Object>
ListenableFuture<java.util.List<@Nullable V>>Futures. successfulAsList(ListenableFuture<? extends V>... futures)Creates a newListenableFuturewhose value is a list containing the values of all its successful input futures.static <V extends @Nullable java.lang.Object>
ListenableFuture<java.util.List<@Nullable V>>Futures. successfulAsList(java.lang.Iterable<? extends ListenableFuture<? extends V>> futures)Creates a newListenableFuturewhose value is a list containing the values of all its successful input futures.static <I extends @Nullable java.lang.Object,O extends @Nullable java.lang.Object>
ListenableFuture<O>Futures. transform(ListenableFuture<I> input, Function<? super I,? extends O> function, java.util.concurrent.Executor executor)Returns a newFuturewhose result is derived from the result of the givenFuture.static <I extends @Nullable java.lang.Object,O extends @Nullable java.lang.Object>
ListenableFuture<O>Futures. transformAsync(ListenableFuture<I> input, AsyncFunction<? super I,? extends O> function, java.util.concurrent.Executor executor)Returns a newFuturewhose result is asynchronously derived from the result of the givenFuture.static <V extends @Nullable java.lang.Object>
ListenableFuture<V>Futures. withTimeout(ListenableFuture<V> delegate, long time, java.util.concurrent.TimeUnit unit, java.util.concurrent.ScheduledExecutorService scheduledExecutor)Returns a future that delegates to another but will finish early (via aTimeoutExceptionwrapped in anExecutionException) if the specified duration expires.Methods in com.google.common.util.concurrent that return types with arguments of type ListenableFuture Modifier and Type Method Description static <T extends @Nullable java.lang.Object>
ImmutableList<ListenableFuture<T>>Futures. inCompletionOrder(java.lang.Iterable<? extends ListenableFuture<? extends T>> futures)Returns a list of delegate futures that correspond to the futures received in the order that they complete.Methods in com.google.common.util.concurrent with parameters of type ListenableFuture Modifier and Type Method Description static <V extends @Nullable java.lang.Object>
voidFutures. addCallback(ListenableFuture<V> future, FutureCallback<? super V> callback, java.util.concurrent.Executor executor)Registers separate success and failure callbacks to be run when theFuture's computation is complete or, if the computation is already complete, immediately.static <V extends @Nullable java.lang.Object>
ListenableFuture<java.util.List<V>>Futures. allAsList(ListenableFuture<? extends V>... futures)Creates a newListenableFuturewhose value is a list containing the values of all its input futures, if all succeed.static <V extends @Nullable java.lang.Object,X extends java.lang.Throwable>
ListenableFuture<V>Futures. catching(ListenableFuture<? extends V> input, java.lang.Class<X> exceptionType, Function<? super X,? extends V> fallback, java.util.concurrent.Executor executor)Returns aFuturewhose result is taken from the given primaryinputor, if the primary input fails with the givenexceptionType, from the result provided by thefallback.static <V extends @Nullable java.lang.Object,X extends java.lang.Throwable>
ListenableFuture<V>Futures. catchingAsync(ListenableFuture<? extends V> input, java.lang.Class<X> exceptionType, AsyncFunction<? super X,? extends V> fallback, java.util.concurrent.Executor executor)Returns aFuturewhose result is taken from the given primaryinputor, if the primary input fails with the givenexceptionType, from the result provided by thefallback.static <C extends @Nullable java.lang.Object & @Nullable java.io.Closeable>
ClosingFuture<C>ClosingFuture. eventuallyClosing(ListenableFuture<C> future, java.util.concurrent.Executor closingExecutor)Deprecated.CreatingFutures of closeable types is dangerous in general because the underlying value may never be closed if theFutureis canceled after its operation begins.static <V extends @Nullable java.lang.Object>
ClosingFuture<V>ClosingFuture. from(ListenableFuture<V> future)Starts aClosingFuturepipeline with aListenableFuture.static <V extends @Nullable java.lang.Object>
FluentFuture<V>FluentFuture. from(ListenableFuture<V> future)Converts the givenListenableFutureto an equivalentFluentFuture.static <V extends @Nullable java.lang.Object>
ListenableFuture<V>Futures. nonCancellationPropagating(ListenableFuture<V> future)Returns aListenableFuturewhose result is set from the supplied future when it completes.protected booleanAbstractFuture. setFuture(ListenableFuture<? extends V> future)Sets the result of thisFutureto match the supplied inputFutureonce the suppliedFutureis done, unless thisFuturehas already been cancelled or set (including "set asynchronously," defined below).booleanSettableFuture. setFuture(ListenableFuture<? extends V> future)static <V extends @Nullable java.lang.Object>
ListenableFuture<java.util.List<@Nullable V>>Futures. successfulAsList(ListenableFuture<? extends V>... futures)Creates a newListenableFuturewhose value is a list containing the values of all its successful input futures.static <I extends @Nullable java.lang.Object,O extends @Nullable java.lang.Object>
ListenableFuture<O>Futures. transform(ListenableFuture<I> input, Function<? super I,? extends O> function, java.util.concurrent.Executor executor)Returns a newFuturewhose result is derived from the result of the givenFuture.static <I extends @Nullable java.lang.Object,O extends @Nullable java.lang.Object>
ListenableFuture<O>Futures. transformAsync(ListenableFuture<I> input, AsyncFunction<? super I,? extends O> function, java.util.concurrent.Executor executor)Returns a newFuturewhose result is asynchronously derived from the result of the givenFuture.static <V extends @Nullable java.lang.Object>
Futures.FutureCombiner<V>Futures. whenAllComplete(ListenableFuture<? extends V>... futures)Creates aFutures.FutureCombinerthat processes the completed futures whether or not they're successful.static <V extends @Nullable java.lang.Object>
Futures.FutureCombiner<V>Futures. whenAllSucceed(ListenableFuture<? extends V>... futures)Creates aFutures.FutureCombinerrequiring that all passed in futures are successful.static <V extends @Nullable java.lang.Object>
ListenableFuture<V>Futures. withTimeout(ListenableFuture<V> delegate, long time, java.util.concurrent.TimeUnit unit, java.util.concurrent.ScheduledExecutorService scheduledExecutor)Returns a future that delegates to another but will finish early (via aTimeoutExceptionwrapped in anExecutionException) if the specified duration expires.Method parameters in com.google.common.util.concurrent with type arguments of type ListenableFuture Modifier and Type Method Description static <V extends @Nullable java.lang.Object>
ListenableFuture<java.util.List<V>>Futures. allAsList(java.lang.Iterable<? extends ListenableFuture<? extends V>> futures)Creates a newListenableFuturewhose value is a list containing the values of all its input futures, if all succeed.static <T extends @Nullable java.lang.Object>
ImmutableList<ListenableFuture<T>>Futures. inCompletionOrder(java.lang.Iterable<? extends ListenableFuture<? extends T>> futures)Returns a list of delegate futures that correspond to the futures received in the order that they complete.static <V extends @Nullable java.lang.Object>
ListenableFuture<java.util.List<@Nullable V>>Futures. successfulAsList(java.lang.Iterable<? extends ListenableFuture<? extends V>> futures)Creates a newListenableFuturewhose value is a list containing the values of all its successful input futures.static <V extends @Nullable java.lang.Object>
Futures.FutureCombiner<V>Futures. whenAllComplete(java.lang.Iterable<? extends ListenableFuture<? extends V>> futures)Creates aFutures.FutureCombinerthat processes the completed futures whether or not they're successful.static <V extends @Nullable java.lang.Object>
Futures.FutureCombiner<V>Futures. whenAllSucceed(java.lang.Iterable<? extends ListenableFuture<? extends V>> futures)Creates aFutures.FutureCombinerrequiring that all passed in futures are successful.Constructors in com.google.common.util.concurrent with parameters of type ListenableFuture Constructor Description SimpleForwardingListenableFuture(ListenableFuture<V> delegate)
-