@CanIgnoreReturnValue @GwtIncompatible public abstract class ForwardingListeningExecutorService extends ForwardingExecutorService implements ListeningExecutorService
| Modifier | Constructor and Description |
|---|---|
protected |
ForwardingListeningExecutorService()
Constructor for use by subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract ListeningExecutorService |
delegate()
Returns the backing delegate instance that methods are forwarded to.
|
<T> ListenableFuture<T> |
submit(Callable<T> task)
Submits a value-returning task for execution and returns a
Future representing the pending results of the task.
|
ListenableFuture<?> |
submit(Runnable task)
Submits a Runnable task for execution and returns a Future
representing that task.
|
<T> ListenableFuture<T> |
submit(Runnable task,
T result)
Submits a Runnable task for execution and returns a Future
representing that task.
|
awaitTermination, execute, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNowtoStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitinvokeAll, invokeAllawaitTermination, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNowprotected ForwardingListeningExecutorService()
protected abstract ListeningExecutorService delegate()
ForwardingObjectForwardingSet.delegate(). Concrete subclasses override this method to supply the
instance being decorated.delegate in class ForwardingExecutorServicepublic <T> ListenableFuture<T> submit(Callable<T> task)
java.util.concurrent.ExecutorServiceget method will return the task's result upon
successful completion.
If you would like to immediately block waiting
for a task, you can use constructions of the form
result = exec.submit(aCallable).get();
Note: The Executors class includes a set of methods
that can convert some other common closure-like objects,
for example, PrivilegedAction to
Callable form so they can be submitted.
submit in interface ListeningExecutorServicesubmit in interface ExecutorServicesubmit in class ForwardingExecutorServiceT - the type of the task's resulttask - the task to submitpublic ListenableFuture<?> submit(Runnable task)
java.util.concurrent.ExecutorServiceget method will
return null upon successful completion.submit in interface ListeningExecutorServicesubmit in interface ExecutorServicesubmit in class ForwardingExecutorServicetask - the task to submitpublic <T> ListenableFuture<T> submit(Runnable task, T result)
java.util.concurrent.ExecutorServiceget method will
return the given result upon successful completion.submit in interface ListeningExecutorServicesubmit in interface ExecutorServicesubmit in class ForwardingExecutorServiceT - the type of the resulttask - the task to submitresult - the result to returnCopyright © 2010–2019. All rights reserved.