Module dev.mccue.guava.concurrent
Package dev.mccue.guava.concurrent
Class AbstractListeningExecutorService
java.lang.Object
java.util.concurrent.AbstractExecutorService
dev.mccue.guava.concurrent.AbstractListeningExecutorService
- All Implemented Interfaces:
ListeningExecutorService,Executor,ExecutorService
@CheckReturnValue
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
- Author:
- Chris Povirk
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final <T extends @Nullable Object>
RunnableFuture<T>newTaskFor(Runnable runnable, T value) protected final <T extends @Nullable Object>
RunnableFuture<T>newTaskFor(Callable<T> callable) <T extends @Nullable Object>
ListenableFuture<T><T extends @Nullable Object>
ListenableFuture<T>Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAnyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNowMethods inherited from interface dev.mccue.guava.concurrent.ListeningExecutorService
awaitTermination, invokeAll, invokeAll, invokeAll, invokeAny
-
Constructor Details
-
AbstractListeningExecutorService
public AbstractListeningExecutorService()
-
-
Method Details
-
newTaskFor
@CanIgnoreReturnValue protected final <T extends @Nullable Object> RunnableFuture<T> newTaskFor(Runnable runnable, T value) - Overrides:
newTaskForin classAbstractExecutorService- Since:
- 19.0 (present with return type
ListenableFutureTasksince 14.0)
-
newTaskFor
@CanIgnoreReturnValue protected final <T extends @Nullable Object> RunnableFuture<T> newTaskFor(Callable<T> callable) - Overrides:
newTaskForin classAbstractExecutorService- Since:
- 19.0 (present with return type
ListenableFutureTasksince 14.0)
-
submit
- Specified by:
submitin interfaceExecutorService- Specified by:
submitin interfaceListeningExecutorService- Overrides:
submitin classAbstractExecutorService- Returns:
- a
ListenableFuturerepresenting pending completion of the task
-
submit
@CanIgnoreReturnValue public <T extends @Nullable Object> ListenableFuture<T> submit(Runnable task, T result) - Specified by:
submitin interfaceExecutorService- Specified by:
submitin interfaceListeningExecutorService- Overrides:
submitin classAbstractExecutorService- Returns:
- a
ListenableFuturerepresenting pending completion of the task
-
submit
@CanIgnoreReturnValue public <T extends @Nullable Object> ListenableFuture<T> submit(Callable<T> task) - Specified by:
submitin interfaceExecutorService- Specified by:
submitin interfaceListeningExecutorService- Overrides:
submitin classAbstractExecutorService- Returns:
- a
ListenableFuturerepresenting pending completion of the task
-