public abstract class AbstractTaskExecutorService extends AbstractTaskExecutor implements TaskExecutorService
TaskExecutorService
implementations.
AbstractTaskExecutorService extends AbstractTaskExecutor with
automatically canceling the task if the executor was shut down, so implementations
does not need to check for shut down.
AbstractTaskExecutor.SubmittedTask<V>| Constructor and Description |
|---|
AbstractTaskExecutorService() |
| Modifier and Type | Method and Description |
|---|---|
<V> CompletionStage<V> |
executeFunction(CancellationToken cancelToken,
CancelableFunction<? extends V> function)
Executes the function at some time in the future.
|
submitTaskclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddTerminateListener, awaitTermination, isShutdown, isTerminated, shutdown, shutdownAndCancel, tryAwaitTerminationexecute, execute, executeStagedpublic <V> CompletionStage<V> executeFunction(CancellationToken cancelToken, CancelableFunction<? extends V> function)
executeFunction in interface TaskExecutorexecuteFunction in class AbstractTaskExecutorV - the type of the result of the submitted functioncancelToken - the CancellationToken which is to be checked
if the submitted task is to be canceled. If this
CancellationToken signals a cancellation request, this
TaskExecutor may choose to not even attempt to execute the
submitted task. This argument may not be null. When the task cannot be
canceled, use the static Cancellation.UNCANCELABLE_TOKEN
for this argument (even in this case, the TaskExecutor may be able to
cancel the task, if it was not submitted for execution).function - the function to be executed by this TaskExecutor. This
argument cannot be null.CompletionStage which can be used to execute tasks
after the completion of the submitted function and process the result of
the submitted function. This method never returns null.Cancellation.createCancellationSource(),
Cancellation.UNCANCELABLE_TOKEN