default void workerQueued(AlignCalcWorkerI worker) {}
default void workerStarted(AlignCalcWorkerI worker) {}
default void workerCompleted(AlignCalcWorkerI worker) {}
+ default void workerCancelled(AlignCalcWorkerI worker) {}
default void workerExceptional(AlignCalcWorkerI worker, Throwable throwable) {}
}
get();
success = true;
}
+ catch (CancellationException e) {
+ Cache.log.debug(format("Worker %s cancelled%n", getWorker().getClass().getName()));
+ notifyCancelled(worker);
+ }
catch (ExecutionException e)
{
exception = e.getCause();
}
}
}
+
+ private void notifyCancelled(AlignCalcWorkerI worker)
+ {
+ for (AlignCalcListener listener : listeners)
+ {
+ try {
+ listener.workerCancelled(worker);
+ } catch (RuntimeException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
private void notifyExceptional(AlignCalcWorkerI worker,
Throwable throwable)