Package step.threadpool
Class ThreadPool
- java.lang.Object
-
- step.threadpool.ThreadPool
-
public class ThreadPool extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ThreadPool.WorkerController<T>
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.ThreadLocal<java.util.Stack<step.threadpool.ThreadPool.BatchContext>>
batchContextStack
-
Constructor Summary
Constructors Constructor Description ThreadPool(ExecutionContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <WORK_ITEM>
voidconsumeWork(java.util.Iterator<WORK_ITEM> workItemIterator, WorkerItemConsumerFactory<WORK_ITEM> workItemConsumerFactory, int numberOfThreads)
protected java.lang.Integer
getAutoNumberOfThreads()
protected boolean
isReentrantThread()
protected java.util.Stack<step.threadpool.ThreadPool.BatchContext>
pushBatchContextToStack(step.threadpool.ThreadPool.BatchContext batchContext)
-
-
-
Constructor Detail
-
ThreadPool
public ThreadPool(ExecutionContext context)
-
-
Method Detail
-
consumeWork
public <WORK_ITEM> void consumeWork(java.util.Iterator<WORK_ITEM> workItemIterator, WorkerItemConsumerFactory<WORK_ITEM> workItemConsumerFactory, int numberOfThreads)
-
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 java.lang.Integer getAutoNumberOfThreads()
-
pushBatchContextToStack
protected java.util.Stack<step.threadpool.ThreadPool.BatchContext> pushBatchContextToStack(step.threadpool.ThreadPool.BatchContext batchContext)
-
-