Uses of Interface
com.google.common.util.concurrent.ListenableFuture
Packages that use ListenableFuture
-
Uses of ListenableFuture in com.google.common.cache
Methods in com.google.common.cache that return ListenableFutureModifier and TypeMethodDescriptionprivate ListenableFuture<V> LocalCache.LoadingValueReference.fullyFailedFuture(Throwable t) (package private) ListenableFuture<V> LocalCache.Segment.loadAsync(K key, int hash, LocalCache.LoadingValueReference<K, V> loadingValueReference, CacheLoader<? super K, V> loader) LocalCache.LoadingValueReference.loadFuture(K key, CacheLoader<? super K, V> loader) Computes or retrieves a replacement value corresponding to an already-cachedkey.Methods in com.google.common.cache with parameters of type ListenableFutureModifier and TypeMethodDescription(package private) VLocalCache.Segment.getAndRecordStats(K key, int hash, LocalCache.LoadingValueReference<K, V> loadingValueReference, ListenableFuture<V> newValue) Waits uninterruptibly fornewValueto be loaded, and then records loading stats. -
Uses of ListenableFuture in com.google.common.util.concurrent
Subinterfaces of ListenableFuture in com.google.common.util.concurrentModifier and TypeInterfaceDescription(package private) static interfaceTag interface marking trusted subclasses.interfaceHelper interface to implement bothListenableFutureandScheduledFuture.Classes in com.google.common.util.concurrent that implement ListenableFutureModifier and TypeClassDescription(package private) classAbstractCatchingFuture<V,X extends Throwable, F, T> Implementations ofFutures.catching*.private static final classAbstractCatchingFuture.AsyncCatchingFuture<V,X extends Throwable> AnAbstractCatchingFuturethat delegates to anAsyncFunctionandAbstractFuture.setFuture(ListenableFuture).private static final classAbstractCatchingFuture.CatchingFuture<V,X extends Throwable> classAn abstract implementation ofListenableFuture, intended for advanced users only.(package private) static classA less abstract subclass of AbstractFuture.(package private) classAbstractTransformFuture<I,O, F, T> Implementations ofFutures.transform*.private static final classAnAbstractTransformFuturethat delegates to anAsyncFunctionandAbstractFuture.setFuture(ListenableFuture).private static final class(package private) classAggregateFuture<InputT,OutputT> A future whose value is derived from a collection of input futures.(package private) classAggregateFutureState<OutputT>A helper which does some thread-safe operations for aggregate futures, which must be implemented differently in GWT.(package private) classCollectionFuture<V,C> Aggregate future that collects (stores) results of each future.(package private) static final class(package private) final classAggregate future that computes its value by calling a callable.classFluentFuture<V>AListenableFuturethat supports fluent chains of operations.(package private) static classA less abstract subclass of AbstractFuture.(package private) final classFluentFuturethat forwards all calls to a delegate.classAListenableFuturewhich forwards all its method calls to another future.static classA simplified version ofForwardingListenableFuturewhere subclasses can pass in an already constructedListenableFutureas the delegate.private static final classprivate static final classA wrapped future that does not propagate cancellation to its delegate.(package private) classHidden superclass ofFluentFuturethat provides us a place to declare special GWT versions of thefamily of methods.invalid reference
FluentFuture.catching(package private) classImplementation ofFutures.immediateFuture(V).(package private) static final class(package private) static final classprivate static classAn adapter to turn aFutureinto aListenableFuture.classAFutureTaskthat also implements theListenableFutureinterface.private static final classprivate static final classfinal classAListenableFuturewhose result can be set by aSettableFuture.set(Object),SettableFuture.setException(Throwable)orSettableFuture.setFuture(ListenableFuture)call.(package private) final classImplementation ofFutures#withTimeout.(package private) classARunnableFuturethat also implements theListenableFutureinterface.Fields in com.google.common.util.concurrent declared as ListenableFutureModifier and TypeFieldDescriptionprivate final ListenableFuture<V> ForwardingFluentFuture.delegateprivate final ListenableFuture<V> ForwardingListenableFuture.SimpleForwardingListenableFuture.delegateprivate ListenableFuture<V> Futures.NonCancellationPropagatingFuture.delegateprivate ListenableFuture<V> TimeoutFuture.delegateRef(package private) final ListenableFuture<? extends V> AbstractFuture.SetFuture.future(package private) ListenableFuture<? extends V> AbstractCatchingFuture.inputFuture(package private) ListenableFuture<? extends I> AbstractTransformFuture.inputFutureprivate final ListenableFuture<? extends T>[]Futures.InCompletionOrderState.inputFutures(package private) static final ListenableFuture<?> ImmediateFuture.NULLFields in com.google.common.util.concurrent with type parameters of type ListenableFutureModifier and TypeFieldDescriptionprivate ImmutableCollection<? extends ListenableFuture<? extends InputT>> AggregateFuture.futuresThe input futures.private final ImmutableList<ListenableFuture<? extends V>> Futures.FutureCombiner.futuresprivate final AtomicReference<ListenableFuture<Void>> ExecutionSequencer.refThis reference acts as a pointer tracking the head of a linked list of ListenableFutures.Methods in com.google.common.util.concurrent that return ListenableFutureModifier and TypeMethodDescriptionstatic <V> ListenableFuture<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> ListenableFuture<List<V>> Futures.allAsList(Iterable<? extends ListenableFuture<? extends V>> futures) Creates a newListenableFuturewhose value is a list containing the values of all its input futures, if all succeed.Returns an outputFutureto use in place of the giveninput.(package private) <V,U> ListenableFuture <U> ClosingFuture.CloseableList.applyClosingFunction(ClosingFuture.ClosingFunction<? super V, U> transformation, V input) AsyncCallable.call()Computes a resultFuture.<C> ListenableFuture<C> Creates theListenableFuturewhich will return the result of callingCallable.call()incombinerwhen all futures complete, using the specifiedexecutor.<C> ListenableFuture<C> Futures.FutureCombiner.callAsync(AsyncCallable<C> combiner, Executor executor) Creates theListenableFuturewhich will return the result of callingAsyncCallable.call()incombinerwhen all futures complete, using the specifiedexecutor.static <V,X extends Throwable>
ListenableFuture<V> Futures.catching(ListenableFuture<? extends V> input, Class<X> exceptionType, Function<? super X, ? extends V> fallback, 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,X extends Throwable>
ListenableFuture<V> Futures.catchingAsync(ListenableFuture<? extends V> input, Class<X> exceptionType, AsyncFunction<? super X, ? extends V> fallback, 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.(package private) static <V,X extends Throwable>
ListenableFuture<V> AbstractCatchingFuture.create(ListenableFuture<? extends V> input, Class<X> exceptionType, Function<? super X, ? extends V> fallback, Executor executor) (package private) static <I,O> ListenableFuture <O> AbstractTransformFuture.create(ListenableFuture<I> input, Function<? super I, ? extends O> function, Executor executor) (package private) static <V> ListenableFuture<V> TimeoutFuture.create(ListenableFuture<V> delegate, long time, TimeUnit unit, ScheduledExecutorService scheduledExecutor) (package private) static <X extends Throwable,V>
ListenableFuture<V> AbstractCatchingFuture.createAsync(ListenableFuture<? extends V> input, Class<X> exceptionType, AsyncFunction<? super X, ? extends V> fallback, Executor executor) (package private) static <I,O> ListenableFuture <O> AbstractTransformFuture.createAsync(ListenableFuture<I> input, AsyncFunction<? super I, ? extends O> function, Executor executor) protected abstract ListenableFuture<? extends V> ForwardingListenableFuture.delegate()protected final ListenableFuture<V> ForwardingListenableFuture.SimpleForwardingListenableFuture.delegate()(package private) ListenableFuture<? extends V> AbstractCatchingFuture.AsyncCatchingFuture.doFallback(AsyncFunction<? super X, ? extends V> fallback, X cause) (package private) ListenableFuture<? extends O> AbstractTransformFuture.AsyncTransformFuture.doTransform(AsyncFunction<? super I, ? extends O> function, I input) private static <T> ListenableFuture<? extends T>[]Futures.gwtCompatibleToArray(Iterable<? extends ListenableFuture<? extends T>> futures) Can't use Iterables.toArray because it's not gwt compatiblestatic <V> ListenableFuture<V> Futures.immediateCancelledFuture()Creates aListenableFuturewhich is cancelled immediately upon construction, so thatisCancelled()always returnstrue.static <V> ListenableFuture<V> Futures.immediateFailedFuture(Throwable throwable) Returns aListenableFuturewhich has an exception set immediately upon construction.static <V> ListenableFuture<V> Futures.immediateFuture(V value) Creates aListenableFuturewhich has its value set immediately upon construction.static ListenableFuture<Void> Futures.immediateVoidFuture()Returns a successfulListenableFuture<Void>.static <V> ListenableFuture<V> JdkFutureAdapters.listenInPoolThread(Future<V> future) Assigns a thread to the givenFutureto provideListenableFuturefunctionality.static <V> ListenableFuture<V> JdkFutureAdapters.listenInPoolThread(Future<V> future, Executor executor) Submits a blocking task for the givenFutureto provideListenableFuturefunctionality.static <V> ListenableFuture<V> Futures.nonCancellationPropagating(ListenableFuture<V> future) Returns aListenableFuturewhose result is set from the supplied future when it completes.Creates theListenableFuturewhich will return the result of runningcombinerwhen all Futures complete.(package private) ListenableFuture<V> CombinedFuture.AsyncCallableInterruptibleTask.runInterruptibly()(package private) ListenableFuture<V> TrustedListenableFutureTask.TrustedFutureInterruptibleAsyncTask.runInterruptibly()static <O> ListenableFuture<O> Futures.scheduleAsync(AsyncCallable<O> callable, long delay, TimeUnit timeUnit, ScheduledExecutorService executorService) Schedulescallableon the specifiedexecutor, returning aFuture.static <O> ListenableFuture<O> Futures.scheduleAsync(AsyncCallable<O> callable, Duration delay, ScheduledExecutorService executorService) Schedulescallableon the specifiedexecutor, returning aFuture.ClosingFuture.statusFuture()Returns a future that finishes when this step does.<T> ListenableFuture<T> <T> ListenableFuture<T> <T> ListenableFuture<T> Enqueues a task to run when the previous task (if any) completes.<T> ListenableFuture<T> <T> ListenableFuture<T> static ListenableFuture<Void> Executesrunnableon the specifiedexecutor, returning aFuturethat will complete after execution.static <O> ListenableFuture<O> Executescallableon the specifiedexecutor, returning aFuture.<T> ListenableFuture<T> <T> ListenableFuture<T> private static <T> ListenableFuture<T> MoreExecutors.submitAndAddQueueListener(ListeningExecutorService executorService, Callable<T> task, BlockingQueue<Future<T>> queue) Submits the task and adds a listener that adds the future toqueuewhen it completes.<T> ListenableFuture<T> ExecutionSequencer.submitAsync(AsyncCallable<T> callable, Executor executor) Enqueues a task to run when the previous task (if any) completes.static <O> ListenableFuture<O> Futures.submitAsync(AsyncCallable<O> callable, Executor executor) Executescallableon the specifiedexecutor, returning aFuture.static <V> ListenableFuture<List<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> ListenableFuture<List<V>> Futures.successfulAsList(Iterable<? extends ListenableFuture<? extends V>> futures) Creates a newListenableFuturewhose value is a list containing the values of all its successful input futures.static <I,O> ListenableFuture <O> Futures.transform(ListenableFuture<I> input, Function<? super I, ? extends O> function, Executor executor) Returns a newFuturewhose result is derived from the result of the givenFuture.static <I,O> ListenableFuture <O> Futures.transformAsync(ListenableFuture<I> input, AsyncFunction<? super I, ? extends O> function, Executor executor) Returns a newFuturewhose result is asynchronously derived from the result of the givenFuture.static <V> ListenableFuture<V> Futures.withTimeout(ListenableFuture<V> delegate, long time, TimeUnit unit, ScheduledExecutorService scheduledExecutor) Returns a future that delegates to another but will finish early (via aTimeoutExceptionwrapped in anExecutionException) if the specified duration expires.static <V> ListenableFuture<V> Futures.withTimeout(ListenableFuture<V> delegate, Duration time, 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 ListenableFutureModifier and TypeMethodDescriptionstatic <T> ImmutableList<ListenableFuture<T>> Futures.inCompletionOrder(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 ListenableFutureModifier and TypeMethodDescriptionstatic <V> voidFutures.addCallback(ListenableFuture<V> future, FutureCallback<? super V> callback, 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.(package private) voidTrustedListenableFutureTask.TrustedFutureInterruptibleAsyncTask.afterRanInterruptiblySuccess(ListenableFuture<V> result) static <V> ListenableFuture<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,X extends Throwable>
ListenableFuture<V> Futures.catching(ListenableFuture<? extends V> input, Class<X> exceptionType, Function<? super X, ? extends V> fallback, 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,X extends Throwable>
ListenableFuture<V> Futures.catchingAsync(ListenableFuture<? extends V> input, Class<X> exceptionType, AsyncFunction<? super X, ? extends V> fallback, 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.(package private) static <V,X extends Throwable>
ListenableFuture<V> AbstractCatchingFuture.create(ListenableFuture<? extends V> input, Class<X> exceptionType, Function<? super X, ? extends V> fallback, Executor executor) (package private) static <I,O> ListenableFuture <O> AbstractTransformFuture.create(ListenableFuture<I> input, Function<? super I, ? extends O> function, Executor executor) (package private) static <V> ListenableFuture<V> TimeoutFuture.create(ListenableFuture<V> delegate, long time, TimeUnit unit, ScheduledExecutorService scheduledExecutor) (package private) static <X extends Throwable,V>
ListenableFuture<V> AbstractCatchingFuture.createAsync(ListenableFuture<? extends V> input, Class<X> exceptionType, AsyncFunction<? super X, ? extends V> fallback, Executor executor) (package private) static <I,O> ListenableFuture <O> AbstractTransformFuture.createAsync(ListenableFuture<I> input, AsyncFunction<? super I, ? extends O> function, Executor executor) static <C extends Object & AutoCloseable>
ClosingFuture<C> ClosingFuture.eventuallyClosing(ListenableFuture<C> future, Executor closingExecutor) Deprecated.static <V> ClosingFuture<V> ClosingFuture.from(ListenableFuture<V> future) Starts aClosingFuturepipeline with aListenableFuture.static <V> FluentFuture<V> FluentFuture.from(ListenableFuture<V> future) Converts the givenListenableFutureto an equivalentFluentFuture.private static ObjectAbstractFuture.getFutureValue(ListenableFuture<?> future) Returns a value that satisfies the contract of theAbstractFuture.valuefield based on the state of given future.static <V> ListenableFuture<V> Futures.nonCancellationPropagating(ListenableFuture<V> future) Returns aListenableFuturewhose result is set from the supplied future when it completes.private voidAggregateFuture.processAllMustSucceedDoneFuture(int index, ListenableFuture<? extends InputT> future) 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) (package private) voidAbstractCatchingFuture.AsyncCatchingFuture.setResult(ListenableFuture<? extends V> result) (package private) voidAbstractTransformFuture.AsyncTransformFuture.setResult(ListenableFuture<? extends O> result) (package private) voidCombinedFuture.AsyncCallableInterruptibleTask.setValue(ListenableFuture<V> value) static <V> ListenableFuture<List<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,O> ListenableFuture <O> Futures.transform(ListenableFuture<I> input, Function<? super I, ? extends O> function, Executor executor) Returns a newFuturewhose result is derived from the result of the givenFuture.static <I,O> ListenableFuture <O> Futures.transformAsync(ListenableFuture<I> input, AsyncFunction<? super I, ? extends O> function, Executor executor) Returns a newFuturewhose result is asynchronously derived from the result of the givenFuture.static <V> Futures.FutureCombiner<V> Futures.whenAllComplete(ListenableFuture<? extends V>... futures) Creates aFutures.FutureCombinerthat processes the completed futures whether or not they're successful.static <V> Futures.FutureCombiner<V> Futures.whenAllSucceed(ListenableFuture<? extends V>... futures) Creates aFutures.FutureCombinerrequiring that all passed in futures are successful.static <V> ListenableFuture<V> Futures.withTimeout(ListenableFuture<V> delegate, long time, TimeUnit unit, ScheduledExecutorService scheduledExecutor) Returns a future that delegates to another but will finish early (via aTimeoutExceptionwrapped in anExecutionException) if the specified duration expires.static <V> ListenableFuture<V> Futures.withTimeout(ListenableFuture<V> delegate, Duration time, 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 ListenableFutureModifier and TypeMethodDescriptionstatic <V> ListenableFuture<List<V>> Futures.allAsList(Iterable<? extends ListenableFuture<? extends V>> futures) Creates a newListenableFuturewhose value is a list containing the values of all its input futures, if all succeed.private static <T> ListenableFuture<? extends T>[]Futures.gwtCompatibleToArray(Iterable<? extends ListenableFuture<? extends T>> futures) Can't use Iterables.toArray because it's not gwt compatiblestatic <T> ImmutableList<ListenableFuture<T>> Futures.inCompletionOrder(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> ListenableFuture<List<V>> Futures.successfulAsList(Iterable<? extends ListenableFuture<? extends V>> futures) Creates a newListenableFuturewhose value is a list containing the values of all its successful input futures.static <V> Futures.FutureCombiner<V> Futures.whenAllComplete(Iterable<? extends ListenableFuture<? extends V>> futures) Creates aFutures.FutureCombinerthat processes the completed futures whether or not they're successful.static <V> Futures.FutureCombiner<V> Futures.whenAllSucceed(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 ListenableFutureModifierConstructorDescription(package private)AbstractCatchingFuture(ListenableFuture<? extends V> inputFuture, Class<X> exceptionType, F fallback) (package private)AbstractTransformFuture(ListenableFuture<? extends I> inputFuture, F function) (package private)AsyncCatchingFuture(ListenableFuture<? extends V> input, Class<X> exceptionType, AsyncFunction<? super X, ? extends V> fallback) (package private)AsyncTransformFuture(ListenableFuture<? extends I> inputFuture, AsyncFunction<? super I, ? extends O> function) (package private)CatchingFuture(ListenableFuture<? extends V> input, Class<X> exceptionType, Function<? super X, ? extends V> fallback) privateClosingFuture(ListenableFuture<V> future) privateClosingFuture(ListenableFuture<V> future, ClosingFuture.CloseableList closeables) (package private)ForwardingFluentFuture(ListenableFuture<V> delegate) privateInCompletionOrderState(ListenableFuture<? extends T>[] inputFutures) ListenableScheduledTask(ListenableFuture<V> listenableDelegate, ScheduledFuture<?> scheduledDelegate) (package private)NonCancellationPropagatingFuture(ListenableFuture<V> delegate) (package private)SetFuture(AbstractFuture<V> owner, ListenableFuture<? extends V> future) protectedSimpleForwardingListenableFuture(ListenableFuture<V> delegate) privateTimeoutFuture(ListenableFuture<V> delegate) (package private)TransformFuture(ListenableFuture<? extends I> inputFuture, Function<? super I, ? extends O> function) Constructor parameters in com.google.common.util.concurrent with type arguments of type ListenableFutureModifierConstructorDescription(package private)AggregateFuture(ImmutableCollection<? extends ListenableFuture<? extends InputT>> futures, boolean allMustSucceed, boolean collectsValues) (package private)CollectionFuture(ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed) (package private)CombinedFuture(ImmutableCollection<? extends ListenableFuture<?>> futures, boolean allMustSucceed, Executor listenerExecutor, AsyncCallable<V> callable) (package private)CombinedFuture(ImmutableCollection<? extends ListenableFuture<?>> futures, boolean allMustSucceed, Executor listenerExecutor, Callable<V> callable) privateFutureCombiner(boolean allMustSucceed, ImmutableList<ListenableFuture<? extends V>> futures) (package private)ListFuture(ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed) -
Uses of ListenableFuture in com.google.common.util.concurrent.testing
Classes in com.google.common.util.concurrent.testing that implement ListenableFutureModifier and TypeClassDescriptionprivate static final classprivate static classFields in com.google.common.util.concurrent.testing declared as ListenableFutureModifier and TypeFieldDescriptionprotected ListenableFuture<Boolean> AbstractListenableFutureTest.futureprivate final ListenableFuture<?> MockFutureListener.futureMethods in com.google.common.util.concurrent.testing that return ListenableFutureModifier and TypeMethodDescriptionprotected abstract <V> ListenableFuture<V> AbstractListenableFutureTest.createListenableFuture(V value, Exception except, CountDownLatch waitOn) Constructs a listenable future with a value available after the latch has counted down.<T> ListenableFuture<T> <T> ListenableFuture<T> Constructors in com.google.common.util.concurrent.testing with parameters of type ListenableFutureModifierConstructorDescription(package private)ImmediateScheduledFuture(ListenableFuture<V> future) MockFutureListener(ListenableFuture<?> future)
Futures of closeable types is dangerous in general because the underlying value may never be closed if theFutureis canceled after its operation begins.