[neon] Can the JobAPI replace the Eclipse.JobGroup functionality [message #1751694] |
Thu, 12 January 2017 15:38 |
Urs Beeli Messages: 573 Registered: October 2012 Location: Bern, Switzerland |
Senior Member |
|
|
As part of our Mars -> Neon migration I've migrated quite a few of single Sync/Async jobs using the new Job-API and that works nicely.
However, I have now stumbled across some code that uses ch.sbb.cisi.fos.scout.client.ui.forms.JobGroup. Is there a corresponding feature in the Neon Job-API?
How do I best migrate the following code:
// OurClientAsyncJob extends scout's ClientAsyncJob by adding some initial data and having a way to handle it at the end of calculation
List<OurClientAsyncJob> jobs = new ArrayList<>();
JobGroup jobGroup = new JobGroup("job-group", numImporterThreads, partitions.size());
int block = 1;
int blocksTotal = partitions.size();
for (List<AnotherBusinessBean> partition : partitions) {
OurClientAsyncJob asyncJob = createAsyncJob(partition), block + "-of-" + blocksTotal);
asyncJob.setSystem(false);
asyncJob.setUser(true);
asyncJob.setJobGroup(jobGroup);
asyncJob.schedule();
jobs.add(asyncJob);
block++;
}
try {
jobGroup.join(0, null);
} catch (OperationCanceledException | InterruptedException e) {
LOGT.error("Error creating job groups", e);
return importResults;
}
for (OurClientAsyncJob job : jobs) {
job.throwOnError();
job.handleResult();
}
}
The main question being how Scout Neon can give me the jobGroup.join() functionality.
[Updated on: Thu, 12 January 2017 15:41] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04286 seconds