use of com.b2international.snowowl.core.jobs.RemoteJob in project snow-owl by b2ihealthcare.
the class ClassificationJobRequest method execute.
@Override
public Boolean execute(final BranchContext context) {
final RemoteJob job = context.service(RemoteJob.class);
final String classificationId = job.getKey();
final Branch branch = context.branch();
final long headTimestamp = branch.headTimestamp();
final ClassificationTracker tracker = context.service(ClassificationTracker.class);
tracker.classificationRunning(classificationId, headTimestamp);
try {
executeClassification(context, classificationId, tracker);
} catch (final ReasonerApiException e) {
tracker.classificationFailed(classificationId);
throw e;
} catch (final Exception e) {
LOGGER.error("Unexpected error encountered while running classification job.", e);
tracker.classificationFailed(classificationId);
throw new ReasonerApiException("Exception caught while running classification.", e);
}
return Boolean.TRUE;
}
Aggregations