public void shutdown() { shutdownInternally(); }
/** * Job completion notification triggered by self */ @Override public void jobFinishedByOther() { try { shutdownInternally(); } finally { if (toNotifyOnComplete != null) { toNotifyOnComplete.jobFinishedByOther(); } } }
/** * Job completion notification triggered by JobManager or self */ @Override public void onFatalError(Throwable exception) { // we log first to make sure an explaining message goes into the log // we even guard the log statement here to increase chances that the error handler // gets the notification on hard critical situations like out-of-memory errors try { log.error("JobManager runner encountered a fatal error.", exception); } catch (Throwable ignored) {} // in any case, notify our handler, so it can react fast try { if (errorHandler != null) { errorHandler.onFatalError(exception); } } finally { // the shutdown may not even needed any more, if the fatal error // handler kills the process. that is fine, a process kill cleans up better than anything. shutdownInternally(); } }
/** * Job completion notification triggered by JobManager */ @Override public void jobFinished(JobExecutionResult result) { try { unregisterJobFromHighAvailability(); shutdownInternally(); } finally { if (toNotifyOnComplete != null) { toNotifyOnComplete.jobFinished(result); } } }
/** * Job completion notification triggered by JobManager */ @Override public void jobFailed(Throwable cause) { try { unregisterJobFromHighAvailability(); shutdownInternally(); } finally { if (toNotifyOnComplete != null) { toNotifyOnComplete.jobFailed(cause); } } }