fScheduledJobs.decrementAndGet();
break;
}
/* Create the Job */
Job job = createJob();
/* Listen to Job's Lifecycle */
job.addJobChangeListener(new JobChangeAdapter() {
/* Update Fields when a Job is Done */
@Override
public void done(IJobChangeEvent event) {
/* Re-Schedule this Job if there is work left to do */
if (!fOpenTasksQueue.isEmpty())
event.getJob().schedule();
else
fScheduledJobs.decrementAndGet();
}
});
/* Do not interrupt on any Error */
job.setProperty(NO_IMMEDIATE_ERROR_PROMPT_PROPERTY, Boolean.TRUE);
/*
* Workaround: Since we are using our own Job for displaying Progress, we
* don't want these Jobs show up in the Progress View. There is currently
* no bug-free solution of aggregating the Progress of N Jobs into a
* single Monitor.
*/
job.setSystem(true);
/* Schedule it immediately */
job.schedule();
}
}