org.wildfly.swarm.config.batch.jberet

## Class ThreadPool<T extends ThreadPool<T>>

- java.lang.Object
- - org.wildfly.swarm.config.batch.jberet.ThreadPool<T>

-     public class ThreadPool<T extends ThreadPool<T>>
      extends Object

  The thread pool used for batch jobs. Note that the max-thread attribute should always be greater than 3. Two threads are reserved to ensure partition jobs can execute.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ThreadPool(String key)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Integer` | `activeCount()` The approximate number of threads that are actively executing tasks.
    `T` | `activeCount(Integer value)` The approximate number of threads that are actively executing tasks.
    `void` | `addPropertyChangeListener(PropertyChangeListener listener)` Adds a property change listener
    `Integer` | `completedTaskCount()` The approximate total number of tasks that have completed execution.
    `T` | `completedTaskCount(Integer value)` The approximate total number of tasks that have completed execution.
    `Integer` | `currentThreadCount()` The current number of threads in the pool.
    `T` | `currentThreadCount(Integer value)` The current number of threads in the pool.
    `String` | `getKey()`
    `Map` | `keepaliveTime()` Used to specify the amount of time that pool threads should be kept running when idle; if not specified, threads will run until the executor is shut down.
    `T` | `keepaliveTime(Map value)` Used to specify the amount of time that pool threads should be kept running when idle; if not specified, threads will run until the executor is shut down.
    `T` | `keepaliveTime(String key, Object value)` Used to specify the amount of time that pool threads should be kept running when idle; if not specified, threads will run until the executor is shut down.
    `Integer` | `largestThreadCount()` The largest number of threads that have ever simultaneously been in the pool.
    `T` | `largestThreadCount(Integer value)` The largest number of threads that have ever simultaneously been in the pool.
    `Integer` | `maxThreads()` The maximum thread pool size.
    `T` | `maxThreads(Integer value)` The maximum thread pool size.
    `String` | `name()` The name of the thread pool.
    `T` | `name(String value)` The name of the thread pool.
    `Integer` | `queueSize()` The queue size.
    `T` | `queueSize(Integer value)` The queue size.
    `Integer` | `rejectedCount()` The number of tasks that have been rejected.
    `T` | `rejectedCount(Integer value)` The number of tasks that have been rejected.
    `void` | `removePropertyChangeListener(PropertyChangeListener listener)` Removes a property change listener
    `Integer` | `taskCount()` The approximate total number of tasks that have ever been scheduled for execution.
    `T` | `taskCount(Integer value)` The approximate total number of tasks that have ever been scheduled for execution.
    `String` | `threadFactory()` Specifies the name of a specific thread factory to use to create worker threads.
    `T` | `threadFactory(String value)` Specifies the name of a specific thread factory to use to create worker threads.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ThreadPool

          public ThreadPool(String key)

  - ### Method Detail

    - #### getKey

          public String getKey()

    - #### addPropertyChangeListener

          public void addPropertyChangeListener(PropertyChangeListener listener)

      Adds a property change listener

    - #### removePropertyChangeListener

          public void removePropertyChangeListener(PropertyChangeListener listener)

      Removes a property change listener

    - #### activeCount

          public Integer activeCount()

      The approximate number of threads that are actively executing tasks.

    - #### activeCount

          public T activeCount(Integer value)

      The approximate number of threads that are actively executing tasks.

    - #### completedTaskCount

          public Integer completedTaskCount()

      The approximate total number of tasks that have completed execution.

    - #### completedTaskCount

          public T completedTaskCount(Integer value)

      The approximate total number of tasks that have completed execution.

    - #### currentThreadCount

          public Integer currentThreadCount()

      The current number of threads in the pool.

    - #### currentThreadCount

          public T currentThreadCount(Integer value)

      The current number of threads in the pool.

    - #### keepaliveTime

          public Map keepaliveTime()

      Used to specify the amount of time that pool threads should be kept running when idle; if not specified, threads will run until the executor is shut down.

    - #### keepaliveTime

          public T keepaliveTime(Map value)

      Used to specify the amount of time that pool threads should be kept running when idle; if not specified, threads will run until the executor is shut down.

    - #### keepaliveTime

          public T keepaliveTime(String key,
                                 Object value)

      Used to specify the amount of time that pool threads should be kept running when idle; if not specified, threads will run until the executor is shut down.

    - #### largestThreadCount

          public Integer largestThreadCount()

      The largest number of threads that have ever simultaneously been in the pool.

    - #### largestThreadCount

          public T largestThreadCount(Integer value)

      The largest number of threads that have ever simultaneously been in the pool.

    - #### maxThreads

          public Integer maxThreads()

      The maximum thread pool size. Note this should always be greater than 3. Two threads are reserved to ensure partition jobs can execute as expected.

    - #### maxThreads

          public T maxThreads(Integer value)

      The maximum thread pool size. Note this should always be greater than 3. Two threads are reserved to ensure partition jobs can execute as expected.

    - #### name

          public String name()

      The name of the thread pool.

    - #### name

          public T name(String value)

      The name of the thread pool.

    - #### queueSize

          public Integer queueSize()

      The queue size.

    - #### queueSize

          public T queueSize(Integer value)

      The queue size.

    - #### rejectedCount

          public Integer rejectedCount()

      The number of tasks that have been rejected.

    - #### rejectedCount

          public T rejectedCount(Integer value)

      The number of tasks that have been rejected.

    - #### taskCount

          public Integer taskCount()

      The approximate total number of tasks that have ever been scheduled for execution.

    - #### taskCount

          public T taskCount(Integer value)

      The approximate total number of tasks that have ever been scheduled for execution.

    - #### threadFactory

          public String threadFactory()

      Specifies the name of a specific thread factory to use to create worker threads. If not defined an appropriate default thread factory will be used.

    - #### threadFactory

          public T threadFactory(String value)

      Specifies the name of a specific thread factory to use to create worker threads. If not defined an appropriate default thread factory will be used.

Copyright © 2017 JBoss by Red Hat. All rights reserved.