Class AbstractListeningExecutorService
java.lang.Object
java.util.concurrent.AbstractExecutorService
com.google.common.util.concurrent.AbstractListeningExecutorService
- All Implemented Interfaces:
ListeningExecutorService
,AutoCloseable
,Executor
,ExecutorService
- Direct Known Subclasses:
DirectExecutorService
,MoreExecutors.ListeningDecorator
,TestingExecutors.NoOpScheduledExecutorService
public abstract class AbstractListeningExecutorService
extends AbstractExecutorService
implements ListeningExecutorService
Abstract
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.
- Since:
- 14.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final <T> RunnableFuture
<T> newTaskFor
(Runnable runnable, T value) protected final <T> RunnableFuture
<T> newTaskFor
(Callable<T> callable) <T> ListenableFuture
<T> <T> ListenableFuture
<T> 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, close, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow
Methods inherited from interface com.google.common.util.concurrent.ListeningExecutorService
awaitTermination, invokeAll, invokeAll, invokeAll, invokeAny
-
Constructor Details
-
AbstractListeningExecutorService
public AbstractListeningExecutorService()
-
-
Method Details
-
newTaskFor
- Overrides:
newTaskFor
in classAbstractExecutorService
- Since:
- 19.0 (present with return type
ListenableFutureTask
since 14.0)
-
newTaskFor
- Overrides:
newTaskFor
in classAbstractExecutorService
- Since:
- 19.0 (present with return type
ListenableFutureTask
since 14.0)
-
submit
- Specified by:
submit
in interfaceExecutorService
- Specified by:
submit
in interfaceListeningExecutorService
- Overrides:
submit
in classAbstractExecutorService
- Returns:
- a
ListenableFuture
representing pending completion of the task
-
submit
- Specified by:
submit
in interfaceExecutorService
- Specified by:
submit
in interfaceListeningExecutorService
- Overrides:
submit
in classAbstractExecutorService
- Returns:
- a
ListenableFuture
representing pending completion of the task
-
submit
- Specified by:
submit
in interfaceExecutorService
- Specified by:
submit
in interfaceListeningExecutorService
- Overrides:
submit
in classAbstractExecutorService
- Returns:
- a
ListenableFuture
representing pending completion of the task
-