Package org.copperengine.core.tranzient
Class TransientPriorityProcessorPool
- java.lang.Object
-
- org.copperengine.core.common.PriorityProcessorPool
-
- org.copperengine.core.tranzient.TransientPriorityProcessorPool
-
- All Implemented Interfaces:
ProcessorPool
,TransientProcessorPool
,org.copperengine.management.ProcessorPoolMXBean
public class TransientPriorityProcessorPool extends PriorityProcessorPool implements TransientProcessorPool
Default implementation of aTransientProcessorPool
, backed by a priority queue and a configurable amount of processor threads.
-
-
Field Summary
-
Fields inherited from class org.copperengine.core.common.PriorityProcessorPool
processorFactory, queue
-
Fields inherited from interface org.copperengine.core.tranzient.TransientProcessorPool
DEFAULT_POOL_ID
-
-
Constructor Summary
Constructors Constructor Description TransientPriorityProcessorPool()
Creates a newTransientPriorityProcessorPool
with as many worker threads as processors available on the corresponding environment.TransientPriorityProcessorPool(java.lang.String id)
Creates a newTransientPriorityProcessorPool
with as many worker threads as processors available on the corresponding environment.TransientPriorityProcessorPool(java.lang.String id, int numberOfThreads)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enqueue(Workflow<?> wf)
int
getQueueSize()
-
Methods inherited from class org.copperengine.core.common.PriorityProcessorPool
createQueue, getEngine, getId, getMemoryQueueSize, getNumberOfActiveThreads, getNumberOfThreads, getProcessorPoolState, getState, getThreadPriority, resume, setEngine, setId, setNumberOfThreads, setProcessorFactory, setShutdownWaitIntervalMSec, setThreadPriority, shutdown, startup, suspend
-
-
-
-
Constructor Detail
-
TransientPriorityProcessorPool
public TransientPriorityProcessorPool()
Creates a newTransientPriorityProcessorPool
with as many worker threads as processors available on the corresponding environment.id
needs to be initialized later using the setter.
-
TransientPriorityProcessorPool
public TransientPriorityProcessorPool(java.lang.String id)
Creates a newTransientPriorityProcessorPool
with as many worker threads as processors available on the corresponding environment.- Parameters:
id
- Unique id of the transient processor pool. Might be specified when creating a workflow or within a workflow fromWorkflow.setProcessorPoolId(java.lang.String)
to let the workflow be run on this processor pool. (After reaching the next checkpoint when already running)
-
TransientPriorityProcessorPool
public TransientPriorityProcessorPool(java.lang.String id, int numberOfThreads)
-
-
Method Detail
-
enqueue
public void enqueue(Workflow<?> wf)
- Specified by:
enqueue
in interfaceTransientProcessorPool
-
getQueueSize
public int getQueueSize()
- Specified by:
getQueueSize
in interfaceorg.copperengine.management.ProcessorPoolMXBean
-
-