public void process() {
Object task;
this.totalTasks = loadWorkload();
int currentTask = 0;
TaskGroup group = EngineConcurrency.getInstance().createTaskGroup();
while (((task = requestNextTask()) != null) && !shouldStop) {
currentTask++;
final JobUnitContext context = new JobUnitContext();
context.setJobUnit(task);
context.setOwner(this);
context.setTaskNumber(currentTask);
final JobUnitWorker worker = new JobUnitWorker(context);
EngineConcurrency.getInstance().processTask(worker, group);
}
group.waitForComplete();
EngineConcurrency.getInstance().checkError();
}