@Singleton public class TaskMasterProviderExecutorService extends Object implements TaskMasterProvider
ExecutorService.| Constructor and Description |
|---|
TaskMasterProviderExecutorService() |
| Modifier and Type | Method and Description |
|---|---|
protected ExecutorService |
getPool(String pool) |
void |
shutdown()
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be
accepted.
|
void |
shutdownNow()
Attempts to stop all actively executing tasks, halts the processing of waiting tasks.
|
<T> TaskFuture<T> |
submit(Runnable task,
T result)
Submits a Runnable task for execution and returns a Future representing that task.
|
<T> TaskFuture<T> |
submit(Runnable task,
T result,
String pool)
Submits a Runnable task for execution and returns a Future representing that task.
|
public void shutdown()
TaskMasterProvidershutdown in interface TaskMasterProviderpublic void shutdownNow()
TaskMasterProvidershutdownNow in interface TaskMasterProviderpublic <T> TaskFuture<T> submit(Runnable task, T result) throws RejectedTaskException
TaskMasterProviderUses the default thread pool.
submit in interface TaskMasterProviderT - the type for the futuretask - the task to submitresult - the result to returnRejectedTaskException - if the task cannot be scheduled for executionpublic <T> TaskFuture<T> submit(Runnable task, T result, String pool) throws RejectedTaskException
TaskMasterProvidersubmit in interface TaskMasterProviderT - the type for the futuretask - the task to submitresult - the result to returnpool - the thread pool name, or null if no poolRejectedTaskException - if the task cannot be scheduled for executionprotected ExecutorService getPool(String pool)
pool - the pool to execute the task inCopyright © 2019. All rights reserved.