@GwtIncompatible public interface ListeningExecutorService extends ExecutorService
ExecutorService that returns ListenableFuture instances. To create an instance
from an existing ExecutorService, call MoreExecutors.listeningDecorator(ExecutorService).| Modifier and Type | Method and Description |
|---|---|
<T> List<Future<T>> |
invokeAll(Collection<? extends Callable<T>> tasks) |
<T> List<Future<T>> |
invokeAll(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit) |
<T> ListenableFuture<T> |
submit(Callable<T> task) |
ListenableFuture<?> |
submit(Runnable task) |
<T> ListenableFuture<T> |
submit(Runnable task,
T result) |
awaitTermination, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow<T> ListenableFuture<T> submit(Callable<T> task)
submit in interface ExecutorServiceListenableFuture representing pending completion of the taskRejectedExecutionExceptionListenableFuture<?> submit(Runnable task)
submit in interface ExecutorServiceListenableFuture representing pending completion of the taskRejectedExecutionException<T> ListenableFuture<T> submit(Runnable task, T result)
submit in interface ExecutorServiceListenableFuture representing pending completion of the taskRejectedExecutionException<T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException
All elements in the returned list must be ListenableFuture instances. The easiest
way to obtain a List<ListenableFuture<T>> from this method is an unchecked (but safe)
cast:
@SuppressWarnings("unchecked") // guaranteed by invokeAll contractList<ListenableFuture<T>> futures = (List) executor.invokeAll(tasks);
invokeAll in interface ExecutorServiceListenableFuture instances representing the tasks, in the same
sequential order as produced by the iterator for the given task list, each of which has
completed.RejectedExecutionExceptionNullPointerException - if any task is nullInterruptedException<T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException
All elements in the returned list must be ListenableFuture instances. The easiest
way to obtain a List<ListenableFuture<T>> from this method is an unchecked (but safe)
cast:
@SuppressWarnings("unchecked") // guaranteed by invokeAll contractList<ListenableFuture<T>> futures = (List) executor.invokeAll(tasks, timeout, unit);
invokeAll in interface ExecutorServiceListenableFuture instances representing the tasks, in the same
sequential order as produced by the iterator for the given task list. If the operation did
not time out, each task will have completed. If it did time out, some of these tasks will
not have completed.RejectedExecutionExceptionNullPointerException - if any task is nullInterruptedExceptionCopyright © 2010–2017. All rights reserved.