// delete this job, we've assigned a final status
try {
context.setResult(bundleDeploymentStatus); // Return status to possible listeners
scheduler.deleteJob(jobDetail.getName(), jobDetail.getGroup());
} catch (SchedulerException e) {
throw new JobExecutionException("Could not delete the bundle deployment completion check job for "
+ bundleDeployment + ".", e);
}
} else {
// try again in 10s
try {
Trigger trigger = QuartzUtil.getFireOnceOffsetTrigger(jobDetail, 10000L);
// just need a trigger name unique for this job
trigger.setName(String.valueOf(System.currentTimeMillis()));
scheduler.scheduleJob(trigger);
} catch (SchedulerException e) {
throw new JobExecutionException(
"Could not schedule the bundle deployment completion check job for " + bundleDeployment + ".",
e);
}
}
}