Class ThreadPool

java.lang.Object
step.threadpool.ThreadPool
All Implemented Interfaces:
Closeable, AutoCloseable

public class ThreadPool extends Object implements Closeable
  • Field Details

    • batchContextStack

      protected ThreadLocal<Stack<step.threadpool.ThreadPool.BatchContext>> batchContextStack
  • Constructor Details

  • Method Details

    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • consumeWork

      public <WORK_ITEM> void consumeWork(Iterator<WORK_ITEM> workItemIterator, WorkerItemConsumerFactory<WORK_ITEM> workItemConsumerFactory, int specifiedNumberOfThreads)
    • consumeWork

      public <WORK_ITEM> void consumeWork(Iterator<WORK_ITEM> workItemIterator, WorkerItemConsumerFactory<WORK_ITEM> workItemConsumerFactory, int specifiedNumberOfThreads, OptionalInt requiredNumberOfThreads)
    • isReentrantThread

      protected boolean isReentrantThread()
      Returns:
      true if the current thread is a reentrant thread. A Thread is called "reentrant" when it is already managed by a ThreadPool
    • getAutoNumberOfThreads

      protected Integer getAutoNumberOfThreads()
    • isAutoNumberOfThreadsConsumed

      protected boolean isAutoNumberOfThreadsConsumed()
    • consumeAutoNumberOfThreads

      protected void consumeAutoNumberOfThreads()
    • pushBatchContextToStack

      protected Stack<step.threadpool.ThreadPool.BatchContext> pushBatchContextToStack(step.threadpool.ThreadPool.BatchContext batchContext)