public class SimpleQueueWorkManager extends org.adroitlogic.ultraesb.core.config.AbstractConfigurationElement implements WorkManager
ConfigurationElement.State
config, debugOn, deploymentUnit, derivedName, id, metricsEngine, outdated, state
WIP_START_TIME_NANO
Constructor and Description |
---|
SimpleQueueWorkManager(org.adroitlogic.ultraesb.core.ConfigurationImpl config)
Create and start a new SimpleWorkManager
|
Modifier and Type | Method and Description |
---|---|
void |
execute(java.lang.Runnable task)
Submit a Runnable task to the executors
|
org.adroitlogic.ultraesb.jmx.view.WorkManagerView |
getDetails() |
int |
getMessageQueueSize()
Number of messages queued
|
int |
getPrimaryActiveCount()
Get primary active threads
|
int |
getSecondaryActiveCount()
Get secondary active threads
|
int |
getWipMapSize()
Number of messages in progress
|
void |
handleCompletion(org.adroitlogic.ultraesb.core.MessageImpl msg)
Remove message from WIP map, and execute completion handler if one exists
|
void |
handleFailedMessage(org.adroitlogic.ultraesb.core.MessageImpl msg)
Handle a message that has failed
|
void |
printWIPMessageDetails()
Writes information about WIP messages into the system log
|
void |
setPrimaryCoreThreads(int primaryCoreThreads) |
void |
setPrimaryKeepaliveSeconds(int primaryKeepaliveSeconds) |
void |
setPrimaryMaxThreads(int primaryMaxThreads) |
void |
setPrimaryQueueSize(int primaryQueueSize) |
void |
setPrimaryTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Assign primary task executor
|
void |
setSecondaryCoreThreads(int secondaryCoreThreads) |
void |
setSecondaryKeepaliveSeconds(int secondaryKeepaliveSeconds) |
void |
setSecondaryMaxThreads(int secondaryMaxThreads) |
void |
setSecondaryQueueSize(int secondaryQueueSize) |
void |
setSecondaryTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Assign secondary task executor
|
void |
start()
Starts the work manager by initializing the task executors
|
void |
stop()
Stops the task executors
|
void |
submitAsync(org.adroitlogic.ultraesb.core.MessageImpl msg,
java.lang.Runnable task)
Submit a task for asynchronous execution by this work manager
|
void |
submitNewMessage(org.adroitlogic.ultraesb.core.MessageImpl msg,
boolean useNewThread)
Submit a new message to the work manager
|
org.adroitlogic.ultraesb.jmx.view.WorkManagerView |
toBasicView()
Return the immutable basic WorkManagerView from JMX.
|
org.adroitlogic.ultraesb.jmx.view.WorkManagerView |
toDetailedView()
Return the immutable WorkManagerView from JMX.
|
void |
updateFromView(org.adroitlogic.ultraesb.jmx.view.WorkManagerView view) |
equals, getDeploymentUnit, getDerivedName, getId, getState, getStreamCount, getTimerStreamMax, getTimerStreamMean, getTimerStreamMin, getTimerStreamPer, hashCode, init, isDebugOn, isStarted, maintenanceShutdown, markAsOutdated, pause, resetCounter, resetTimer, resolveMetricsStreams, resume, setBeanName, setConfig, setDebugOn, setDerivedName, setId, setMetricsEngine, setState, throwIllegalStateException, undeploy
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getId
getDerivedName, getState, isDebugOn, isStarted, maintenanceShutdown, pause, resume, retire, setConfig
public SimpleQueueWorkManager(org.adroitlogic.ultraesb.core.ConfigurationImpl config)
config
- the UltraESB Configurationpublic void setPrimaryTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
taskExecutor
- primary task executorpublic int getPrimaryActiveCount()
public int getSecondaryActiveCount()
public void setSecondaryTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
taskExecutor
- secondary task executorpublic void start()
start
in interface ConfigurationElement
start
in interface WorkManager
start
in class org.adroitlogic.ultraesb.core.config.AbstractConfigurationElement
public void stop()
stop
in interface ConfigurationElement
stop
in interface WorkManager
stop
in class org.adroitlogic.ultraesb.core.config.AbstractConfigurationElement
public void submitNewMessage(org.adroitlogic.ultraesb.core.MessageImpl msg, boolean useNewThread) throws org.adroitlogic.ultraesb.core.work.WorkException
submitNewMessage
in interface WorkManager
msg
- The new message submitted for processinguseNewThread
- true - WorkManager should process the message in a new thread, false - use caller threadWorkException
public void submitAsync(org.adroitlogic.ultraesb.core.MessageImpl msg, java.lang.Runnable task)
submitAsync
in interface WorkManager
msg
- the message to be made available to the async thread, also as a thread local variabletask
- a Runnable task to be executed asynchronouslypublic void execute(java.lang.Runnable task)
execute
in interface java.util.concurrent.Executor
execute
in interface org.springframework.core.task.TaskExecutor
task
- task to be executedpublic void handleFailedMessage(org.adroitlogic.ultraesb.core.MessageImpl msg)
handleFailedMessage
in interface WorkManager
msg
- message that has failedpublic void handleCompletion(org.adroitlogic.ultraesb.core.MessageImpl msg)
handleCompletion
in interface WorkManager
msg
- the completed messagepublic int getMessageQueueSize()
getMessageQueueSize
in interface WorkManager
public int getWipMapSize()
getWipMapSize
in interface WorkManager
public void printWIPMessageDetails()
printWIPMessageDetails
in interface WorkManager
public void setPrimaryCoreThreads(int primaryCoreThreads)
public void setPrimaryMaxThreads(int primaryMaxThreads)
public void setPrimaryQueueSize(int primaryQueueSize)
public void setPrimaryKeepaliveSeconds(int primaryKeepaliveSeconds)
public void setSecondaryCoreThreads(int secondaryCoreThreads)
public void setSecondaryMaxThreads(int secondaryMaxThreads)
public void setSecondaryQueueSize(int secondaryQueueSize)
public void setSecondaryKeepaliveSeconds(int secondaryKeepaliveSeconds)
public org.adroitlogic.ultraesb.jmx.view.WorkManagerView toBasicView()
toBasicView
in interface WorkManager
public org.adroitlogic.ultraesb.jmx.view.WorkManagerView toDetailedView()
toDetailedView
in interface WorkManager
public void updateFromView(org.adroitlogic.ultraesb.jmx.view.WorkManagerView view)
updateFromView
in interface WorkManager
public org.adroitlogic.ultraesb.jmx.view.WorkManagerView getDetails()
getDetails
in interface org.adroitlogic.ultraesb.jmx.element.WorkManagerMXBean