org.wildfly.swarm.config.jca

## Class LongRunningThreads<T extends LongRunningThreads<T>>

- java.lang.Object
- - org.wildfly.swarm.config.jca.LongRunningThreads<T>

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

  A thread pool executor with a bounded queue where threads submittings tasks will not block. Such a thread pool has a core and maximum size and a specified queue length. When a task is submitted, if the number of running threads is less than the core size, a new thread is created. Otherwise, if there is room in the queue, the task is enqueued. Otherwise, if the number of running threads is less than the maximum size, a new thread is created. Otherwise, the task is handed off to the designated handoff executor, if one is specified. Otherwise, the task is discarded.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LongRunningThreads(String key)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPropertyChangeListener(PropertyChangeListener listener)` Adds a property change listener
    `Boolean` | `allowCoreTimeout()` Whether core threads may time out.
    `T` | `allowCoreTimeout(Boolean value)` Whether core threads may time out.
    `Integer` | `coreThreads()` The core thread pool size which is smaller than the maximum pool size.
    `T` | `coreThreads(Integer value)` The core thread pool size which is smaller than the maximum pool size.
    `Integer` | `currentThreadCount()` The current number of threads in the pool.
    `T` | `currentThreadCount(Integer value)` The current number of threads in the pool.
    `String` | `getKey()`
    `String` | `handoffExecutor()` An executor to delegate tasks to in the event that a task cannot be accepted.
    `T` | `handoffExecutor(String value)` An executor to delegate tasks to in the event that a task cannot be accepted.
    `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` | `queueLength()` The queue length.
    `T` | `queueLength(Integer value)` The queue length.
    `Integer` | `queueSize()` The queue size.
    `T` | `queueSize(Integer value)` The queue size.
    `Integer` | `rejectedCount()` The number of tasks that have been passed to the handoff-executor (if one is specified) or discarded.
    `T` | `rejectedCount(Integer value)` The number of tasks that have been passed to the handoff-executor (if one is specified) or discarded.
    `void` | `removePropertyChangeListener(PropertyChangeListener listener)` Removes a property change listener
    `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

    - #### LongRunningThreads

          public LongRunningThreads(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

    - #### allowCoreTimeout

          public Boolean allowCoreTimeout()

      Whether core threads may time out.

    - #### allowCoreTimeout

          public T allowCoreTimeout(Boolean value)

      Whether core threads may time out.

    - #### coreThreads

          public Integer coreThreads()

      The core thread pool size which is smaller than the maximum pool size. If undefined, the core thread pool size is the same as the maximum thread pool size.

    - #### coreThreads

          public T coreThreads(Integer value)

      The core thread pool size which is smaller than the maximum pool size. If undefined, the core thread pool size is the same as the maximum thread pool size.

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

    - #### handoffExecutor

          public String handoffExecutor()

      An executor to delegate tasks to in the event that a task cannot be accepted. If not specified, tasks that cannot be accepted will be silently discarded.

    - #### handoffExecutor

          public T handoffExecutor(String value)

      An executor to delegate tasks to in the event that a task cannot be accepted. If not specified, tasks that cannot be accepted will be silently discarded.

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

    - #### queueLength

          public Integer queueLength()

      The queue length.

    - #### queueLength

          public T queueLength(Integer value)

      The queue length.

    - #### 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 passed to the handoff-executor (if one is specified) or discarded.

    - #### rejectedCount

          public T rejectedCount(Integer value)

      The number of tasks that have been passed to the handoff-executor (if one is specified) or discarded.

    - #### 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 © 2018 JBoss by Red Hat. All rights reserved.