use of org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable in project Activiti by Activiti.
the class HazelCastDistributedQueueBasedAsyncExecutor method initJobQueueListener.
protected void initJobQueueListener() {
jobQueueListenerThread = new Thread(new Runnable() {
public void run() {
while (isActive) {
JobEntity job = null;
try {
// Blocking
job = jobQueue.take();
} catch (InterruptedException e1) {
logger.info("jobQueueListenerThread interrupted. This is fine if the job executor is shutting down");
// Do nothing, this can happen when shutting down
} catch (HazelcastInstanceNotActiveException notActiveException) {
logger.info("Hazel cast not active exception caught. This is fine if the job executor is shutting down");
}
if (job != null) {
executorService.execute(new ExecuteAsyncRunnable(job, commandExecutor));
}
}
}
});
jobQueueListenerThread.start();
}
Aggregations