@Beta public abstract class AbstractListeningExecutorService extends java.util.concurrent.AbstractExecutorService implements ListeningExecutorService
ListeningExecutorService
implementation that creates
ListenableFutureTask
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> ListenableFutureTask<T> |
newTaskFor(java.util.concurrent.Callable<T> callable) |
protected <T> ListenableFutureTask<T> |
newTaskFor(java.lang.Runnable runnable,
T value) |
<T> ListenableFuture<T> |
submit(java.util.concurrent.Callable<T> task) |
ListenableFuture<?> |
submit(java.lang.Runnable task) |
<T> ListenableFuture<T> |
submit(java.lang.Runnable task,
T result) |
invokeAll, invokeAll, invokeAny, invokeAny
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
invokeAll, invokeAll
protected final <T> ListenableFutureTask<T> newTaskFor(java.lang.Runnable runnable, T value)
newTaskFor
in class java.util.concurrent.AbstractExecutorService
protected final <T> ListenableFutureTask<T> newTaskFor(java.util.concurrent.Callable<T> callable)
newTaskFor
in class java.util.concurrent.AbstractExecutorService
public ListenableFuture<?> submit(java.lang.Runnable task)
submit
in interface ListeningExecutorService
submit
in interface java.util.concurrent.ExecutorService
submit
in class java.util.concurrent.AbstractExecutorService
ListenableFuture
representing pending completion of the taskpublic <T> ListenableFuture<T> submit(java.lang.Runnable task, @Nullable T result)
submit
in interface ListeningExecutorService
submit
in interface java.util.concurrent.ExecutorService
submit
in class java.util.concurrent.AbstractExecutorService
ListenableFuture
representing pending completion of the taskpublic <T> ListenableFuture<T> submit(java.util.concurrent.Callable<T> task)
submit
in interface ListeningExecutorService
submit
in interface java.util.concurrent.ExecutorService
submit
in class java.util.concurrent.AbstractExecutorService
ListenableFuture
representing pending completion of the task