Package org.copperengine.core.persistent
Class PersistentPriorityProcessorPool
- java.lang.Object
-
- org.copperengine.core.common.PriorityProcessorPool
-
- org.copperengine.core.persistent.PersistentPriorityProcessorPool
-
- All Implemented Interfaces:
ProcessorPool
,PersistentProcessorPool
,org.copperengine.management.PersistentPriorityProcessorPoolMXBean
,org.copperengine.management.ProcessorPoolMXBean
public class PersistentPriorityProcessorPool extends PriorityProcessorPool implements PersistentProcessorPool, org.copperengine.management.PersistentPriorityProcessorPoolMXBean
Implementation of thePriorityProcessorPool
interface for use in thePersistentScottyEngine
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_DEQUEUE_SIZE
-
Fields inherited from class org.copperengine.core.common.PriorityProcessorPool
processorFactory, queue
-
Fields inherited from interface org.copperengine.core.persistent.PersistentProcessorPool
DEFAULT_POOL_ID
-
-
Constructor Summary
Constructors Constructor Description PersistentPriorityProcessorPool()
Creates a newPersistentPriorityProcessorPool
with as many worker threads as processors available on the corresponding environment.PersistentPriorityProcessorPool(java.lang.String id, TransactionController transactionController)
Creates a newPersistentPriorityProcessorPool
with as many worker threads as processors available on the corresponding environment.PersistentPriorityProcessorPool(java.lang.String id, TransactionController transactionController, int numberOfThreads)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Queue<Workflow<?>>
createQueue()
Creates a new instance ofWfPriorityQueue
void
doNotify()
int
getDequeueBulkSize()
int
getEmptyQueueWaitMSec()
int
getLowerThreshold()
int
getQueueSize()
protected TransactionController
getTransactionController()
int
getUpperThreshold()
int
getUpperThresholdReachedWaitMSec()
void
resumeDequeue()
Resumes dequeuing of workflow instances from the storage.void
setDequeueBulkSize(int dequeueBulkSize)
void
setEmptyQueueWaitMSec(int emptyQueueWaitMSec)
void
setLowerThreshold(int lowerThreshold)
void
setTransactionController(TransactionController transactionController)
void
setUpperThreshold(int upperThreshold)
void
setUpperThresholdReachedWaitMSec(int upperThresholdReachedWaitMSec)
void
shutdown()
Shuts down the processor poolvoid
startup()
Starts up the processor poolvoid
suspendDequeue()
Suspends dequeuing of workflow instances from the storage.-
Methods inherited from class org.copperengine.core.common.PriorityProcessorPool
getEngine, getId, getMemoryQueueSize, getNumberOfActiveThreads, getNumberOfThreads, getProcessorPoolState, getState, getThreadPriority, resume, setEngine, setId, setNumberOfThreads, setProcessorFactory, setShutdownWaitIntervalMSec, setThreadPriority, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.copperengine.core.common.ProcessorPool
getId, resume, setEngine, suspend
-
-
-
-
Field Detail
-
DEFAULT_DEQUEUE_SIZE
public static final int DEFAULT_DEQUEUE_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PersistentPriorityProcessorPool
public PersistentPriorityProcessorPool()
Creates a newPersistentPriorityProcessorPool
with as many worker threads as processors available on the corresponding environment.id
andtransactionControler
need to be initialized later using the setter.
-
PersistentPriorityProcessorPool
public PersistentPriorityProcessorPool(java.lang.String id, TransactionController transactionController)
Creates a newPersistentPriorityProcessorPool
with as many worker threads as processors available on the corresponding environment.- Parameters:
id
- unique id of the newly created processor pool. (Must not be longer than 32 chars to be stored in database)transactionController
- transaction controller which shall handle the transactions for workflows in between two checkpoints (i.e. between two calls to wait/resubmit/savepoint or from start to first occurence of those, or from last occurence to end). The transaction controller is only held in this class but used by thePersistentProcessor
s.
-
PersistentPriorityProcessorPool
public PersistentPriorityProcessorPool(java.lang.String id, TransactionController transactionController, int numberOfThreads)
-
-
Method Detail
-
setTransactionController
public void setTransactionController(TransactionController transactionController)
-
createQueue
protected java.util.Queue<Workflow<?>> createQueue()
Description copied from class:PriorityProcessorPool
Creates a new instance ofWfPriorityQueue
- Overrides:
createQueue
in classPriorityProcessorPool
- Returns:
- the new created instance.
-
startup
public void startup()
Description copied from interface:ProcessorPool
Starts up the processor pool- Specified by:
startup
in interfaceProcessorPool
- Overrides:
startup
in classPriorityProcessorPool
-
shutdown
public void shutdown()
Description copied from interface:ProcessorPool
Shuts down the processor pool- Specified by:
shutdown
in interfaceProcessorPool
- Overrides:
shutdown
in classPriorityProcessorPool
-
doNotify
public void doNotify()
- Specified by:
doNotify
in interfacePersistentProcessorPool
-
setLowerThreshold
public void setLowerThreshold(int lowerThreshold)
- Specified by:
setLowerThreshold
in interfaceorg.copperengine.management.PersistentPriorityProcessorPoolMXBean
-
getLowerThreshold
public int getLowerThreshold()
- Specified by:
getLowerThreshold
in interfaceorg.copperengine.management.PersistentPriorityProcessorPoolMXBean
-
setUpperThreshold
public void setUpperThreshold(int upperThreshold)
- Specified by:
setUpperThreshold
in interfaceorg.copperengine.management.PersistentPriorityProcessorPoolMXBean
-
getUpperThreshold
public int getUpperThreshold()
- Specified by:
getUpperThreshold
in interfaceorg.copperengine.management.PersistentPriorityProcessorPoolMXBean
-
getUpperThresholdReachedWaitMSec
public int getUpperThresholdReachedWaitMSec()
- Specified by:
getUpperThresholdReachedWaitMSec
in interfaceorg.copperengine.management.PersistentPriorityProcessorPoolMXBean
-
setUpperThresholdReachedWaitMSec
public void setUpperThresholdReachedWaitMSec(int upperThresholdReachedWaitMSec)
- Specified by:
setUpperThresholdReachedWaitMSec
in interfaceorg.copperengine.management.PersistentPriorityProcessorPoolMXBean
-
getEmptyQueueWaitMSec
public int getEmptyQueueWaitMSec()
- Specified by:
getEmptyQueueWaitMSec
in interfaceorg.copperengine.management.PersistentPriorityProcessorPoolMXBean
-
setEmptyQueueWaitMSec
public void setEmptyQueueWaitMSec(int emptyQueueWaitMSec)
- Specified by:
setEmptyQueueWaitMSec
in interfaceorg.copperengine.management.PersistentPriorityProcessorPoolMXBean
-
getDequeueBulkSize
public int getDequeueBulkSize()
- Specified by:
getDequeueBulkSize
in interfaceorg.copperengine.management.PersistentPriorityProcessorPoolMXBean
-
setDequeueBulkSize
public void setDequeueBulkSize(int dequeueBulkSize)
- Specified by:
setDequeueBulkSize
in interfaceorg.copperengine.management.PersistentPriorityProcessorPoolMXBean
-
getTransactionController
protected TransactionController getTransactionController()
-
suspendDequeue
public void suspendDequeue()
Description copied from interface:PersistentProcessorPool
Suspends dequeuing of workflow instances from the storage. Workflow instances that already reside in the transient queue are still processed, i.e. calling this methods runs this processor pool "dry".- Specified by:
suspendDequeue
in interfaceorg.copperengine.management.PersistentPriorityProcessorPoolMXBean
- Specified by:
suspendDequeue
in interfacePersistentProcessorPool
- See Also:
PersistentProcessorPool.resumeDequeue()
-
resumeDequeue
public void resumeDequeue()
Description copied from interface:PersistentProcessorPool
Resumes dequeuing of workflow instances from the storage.- Specified by:
resumeDequeue
in interfaceorg.copperengine.management.PersistentPriorityProcessorPoolMXBean
- Specified by:
resumeDequeue
in interfacePersistentProcessorPool
- See Also:
PersistentProcessorPool.suspendDequeue()
-
getQueueSize
public int getQueueSize()
- Specified by:
getQueueSize
in interfaceorg.copperengine.management.ProcessorPoolMXBean
-
-