Package step.threadpool
Class ThreadPool
java.lang.Object
step.threadpool.ThreadPool
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected ThreadLocal<Stack<step.threadpool.ThreadPool.BatchContext>>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
<WORK_ITEM>
voidconsumeWork
(Iterator<WORK_ITEM> workItemIterator, WorkerItemConsumerFactory<WORK_ITEM> workItemConsumerFactory, int specifiedNumberOfThreads) <WORK_ITEM>
voidconsumeWork
(Iterator<WORK_ITEM> workItemIterator, WorkerItemConsumerFactory<WORK_ITEM> workItemConsumerFactory, int specifiedNumberOfThreads, OptionalInt requiredNumberOfThreads) protected Integer
protected boolean
protected boolean
protected Stack<step.threadpool.ThreadPool.BatchContext>
pushBatchContextToStack
(step.threadpool.ThreadPool.BatchContext batchContext)
-
Field Details
-
batchContextStack
-
-
Constructor Details
-
ThreadPool
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- 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
-
isAutoNumberOfThreadsConsumed
protected boolean isAutoNumberOfThreadsConsumed() -
consumeAutoNumberOfThreads
protected void consumeAutoNumberOfThreads() -
pushBatchContextToStack
protected Stack<step.threadpool.ThreadPool.BatchContext> pushBatchContextToStack(step.threadpool.ThreadPool.BatchContext batchContext)
-