org.wildfly.swarm.config.ejb3

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

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

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

  A thread pool executor with an unbounded queue. Such a thread pool has a core size and a queue with no upper bound. When a task is submitted, if the number of running threads is less than the core size, a new thread is created. Otherwise, the task is placed in queue. If too many tasks are allowed to be submitted to this type of executor, an out of memory condition may occur.

- - ### 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.

    - #### maxThreads

          public T maxThreads(Integer value)

      The maximum thread pool size.

    - #### 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.