Class AbstractListeningExecutorService
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- com.google.common.util.concurrent.AbstractListeningExecutorService
-
- All Implemented Interfaces:
ListeningExecutorService,java.util.concurrent.Executor,java.util.concurrent.ExecutorService
@CheckReturnValue @GwtIncompatible public abstract class AbstractListeningExecutorService extends java.util.concurrent.AbstractExecutorService implements ListeningExecutorService
AbstractListeningExecutorServiceimplementation that createsListenableFutureinstances for eachRunnableandCallablesubmitted to it. These tasks are run with the abstractexecute(Runnable)method.In addition to
Executor.execute(java.lang.Runnable), subclasses must implement all methods related to shutdown and termination.- Since:
- 14.0
- Author:
- Chris Povirk
-
-
Constructor Summary
Constructors Constructor Description AbstractListeningExecutorService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T extends @Nullable java.lang.Object>
java.util.concurrent.RunnableFuture<T>newTaskFor(java.lang.Runnable runnable, T value)protected <T extends @Nullable java.lang.Object>
java.util.concurrent.RunnableFuture<T>newTaskFor(java.util.concurrent.Callable<T> callable)ListenableFuture<?>submit(java.lang.Runnable task)<T extends @Nullable java.lang.Object>
ListenableFuture<T>submit(java.lang.Runnable task, T result)<T extends @Nullable java.lang.Object>
ListenableFuture<T>submit(java.util.concurrent.Callable<T> task)-
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow
-
Methods inherited from interface com.google.common.util.concurrent.ListeningExecutorService
awaitTermination, invokeAll, invokeAll, invokeAll, invokeAny
-
-
-
-
Constructor Detail
-
AbstractListeningExecutorService
public AbstractListeningExecutorService()
-
-
Method Detail
-
newTaskFor
@CanIgnoreReturnValue protected final <T extends @Nullable java.lang.Object> java.util.concurrent.RunnableFuture<T> newTaskFor(java.lang.Runnable runnable, T value)
- Overrides:
newTaskForin classjava.util.concurrent.AbstractExecutorService- Since:
- 19.0 (present with return type
ListenableFutureTasksince 14.0)
-
newTaskFor
@CanIgnoreReturnValue protected final <T extends @Nullable java.lang.Object> java.util.concurrent.RunnableFuture<T> newTaskFor(java.util.concurrent.Callable<T> callable)
- Overrides:
newTaskForin classjava.util.concurrent.AbstractExecutorService- Since:
- 19.0 (present with return type
ListenableFutureTasksince 14.0)
-
submit
@CanIgnoreReturnValue public ListenableFuture<?> submit(java.lang.Runnable task)
- Specified by:
submitin interfacejava.util.concurrent.ExecutorService- Specified by:
submitin interfaceListeningExecutorService- Overrides:
submitin classjava.util.concurrent.AbstractExecutorService- Returns:
- a
ListenableFuturerepresenting pending completion of the task
-
submit
@CanIgnoreReturnValue public <T extends @Nullable java.lang.Object> ListenableFuture<T> submit(java.lang.Runnable task, T result)
- Specified by:
submitin interfacejava.util.concurrent.ExecutorService- Specified by:
submitin interfaceListeningExecutorService- Overrides:
submitin classjava.util.concurrent.AbstractExecutorService- Returns:
- a
ListenableFuturerepresenting pending completion of the task
-
submit
@CanIgnoreReturnValue public <T extends @Nullable java.lang.Object> ListenableFuture<T> submit(java.util.concurrent.Callable<T> task)
- Specified by:
submitin interfacejava.util.concurrent.ExecutorService- Specified by:
submitin interfaceListeningExecutorService- Overrides:
submitin classjava.util.concurrent.AbstractExecutorService- Returns:
- a
ListenableFuturerepresenting pending completion of the task
-
-