Package org.apache.batchee.container.services.executor

## Class AbstractThreadPoolService

- java.lang.Object
- - org.apache.batchee.container.services.executor.AbstractThreadPoolService

- All Implemented Interfaces:
    `BatchService`, `BatchThreadPoolService`
  Direct Known Subclasses:
    `BoundedThreadPoolService`, `DefaultThreadPoolService`

      public abstract class AbstractThreadPoolService
      extends Object
      implements BatchThreadPoolService

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected ExecutorService` | `executorService` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractThreadPoolService()` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `executeTask​(Runnable work, Object config)` | (Required) Runs the given task.
    `void` | `init​(Properties batchConfig)` |
    `protected abstract ExecutorService` | `newExecutorService​(Properties batchConfig)` |
    `void` | `shutdown()` |
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### executorService

          protected ExecutorService executorService

  - ### Constructor Detail

    - #### AbstractThreadPoolService

          public AbstractThreadPoolService()

  - ### Method Detail

    - #### newExecutorService

          protected abstract ExecutorService newExecutorService​(Properties batchConfig)

    - #### init

          public void init​(Properties batchConfig)
                    throws BatchContainerServiceException

      Specified by:
        `init` in interface `BatchService`
      Throws:
        `BatchContainerServiceException`

    - #### shutdown

          public void shutdown()
                        throws BatchContainerServiceException

      Specified by:
        `shutdown` in interface `BatchThreadPoolService`
      Throws:
        `BatchContainerServiceException`

    - #### executeTask

          public void executeTask​(Runnable work,
                                  Object config)

      Description copied from interface: `BatchThreadPoolService`
      (Required) Runs the given task. A task is usually short lived
      Specified by:
        `executeTask` in interface `BatchThreadPoolService`
      Parameters:
        `work` - The task to execute
        `config` - Optional configuration to customize the execution. The Container always passes a null value. Typically used when other user plugins wish to use the ExecutorService to execute tasks.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`