@Beta @GwtIncompatible public abstract class AbstractListeningExecutorService extends AbstractExecutorService implements ListeningExecutorService
ListeningExecutorService
implementation that creates ListenableFuture
instances for each Runnable
and Callable
submitted to it. These tasks are run
with the abstract execute(Runnable)
method.
In addition to Executor.execute(java.lang.Runnable)
, subclasses must implement all methods related to shutdown and
termination.
Constructor and Description |
---|
AbstractListeningExecutorService() |
Modifier and Type | Method and Description |
---|---|
protected <T> RunnableFuture<T> |
newTaskFor(Callable<T> callable) |
protected <T> RunnableFuture<T> |
newTaskFor(Runnable runnable,
T value) |
<T> ListenableFuture<T> |
submit(Callable<T> task) |
ListenableFuture<?> |
submit(Runnable task) |
<T> ListenableFuture<T> |
submit(Runnable task,
T result) |
invokeAll, invokeAll, invokeAny, invokeAny
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
invokeAll, invokeAll
awaitTermination, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow
public AbstractListeningExecutorService()
protected final <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value)
newTaskFor
in class AbstractExecutorService
ListenableFutureTask
since 14.0)protected final <T> RunnableFuture<T> newTaskFor(Callable<T> callable)
newTaskFor
in class AbstractExecutorService
ListenableFutureTask
since 14.0)public ListenableFuture<?> submit(Runnable task)
submit
in interface ListeningExecutorService
submit
in interface ExecutorService
submit
in class AbstractExecutorService
ListenableFuture
representing pending completion of the taskpublic <T> ListenableFuture<T> submit(Runnable task, @Nullable T result)
submit
in interface ListeningExecutorService
submit
in interface ExecutorService
submit
in class AbstractExecutorService
ListenableFuture
representing pending completion of the taskpublic <T> ListenableFuture<T> submit(Callable<T> task)
submit
in interface ListeningExecutorService
submit
in interface ExecutorService
submit
in class AbstractExecutorService
ListenableFuture
representing pending completion of the taskCopyright © 2010–2017. All rights reserved.