public void run() { try { task.run(); } catch (Throwable t) { errorHandler.handle(t); } } });
public void run() { try { this.target.run(); } catch (Throwable t) { if (SimpleTaskScheduler.this.errorHandler != null) { SimpleTaskScheduler.this.errorHandler.handle(t); } else if (logger.isErrorEnabled()) { logger.error("Error occurred in task but no 'errorHandler' is available.", t); } } } }
public void run() { try { this.target.run(); } catch (Throwable t) { if (SimpleTaskScheduler.this.errorHandler != null) { SimpleTaskScheduler.this.errorHandler.handle(t); } else if (logger.isErrorEnabled()) { logger.error("Error occurred in task but no 'errorHandler' is available.", t); } } } }
protected boolean processFinishing(String pid) { try { // cleaning iterator iterator.clean(); final Message<GenericProcessOrchestrationPayload> finishingMessage = messageRegistry.finish(pid); // send PROCESS_FINISHING message if (finishingMessage != null) { boolean sentSuccessfully = outputChannel.send(finishingMessage); if (!sentSuccessfully) { log.info("finishing error, failed to send reply Message"); errorHandler.handle(new MessageDeliveryException( finishingMessage, "failed to send reply Message")); } return sentSuccessfully; } else { log.error("got null finishing message from MessageRegistry!"); return false; } } catch (Exception e) { log.error("Error ocurred in MessageRegistry" + " during process finishing",e); return false; } }
protected boolean processInterrupting(String processId) { if (iterator==null) { // iterator builder does not finished its job, postponing interruption interruptPostponedWhileBuildingIterator = true; return true; } else { iterator.clean(); try { final Message<GenericProcessOrchestrationPayload> interruptingMessage = messageRegistry .interrupt(processId); // send PROCESS_INTERRUPTING message if (interruptingMessage != null) { boolean sentSuccessfully = outputChannel.send(interruptingMessage); if (!sentSuccessfully) { errorHandler.handle(new MessageDeliveryException( interruptingMessage, "failed to send reply Message")); } return sentSuccessfully; } else { log.error("got null interrupting message from MessageRegistry!"); return false; } } catch (Exception e) { log.error("Error ocurred in MessageRegistry" + " while interrupting process", e); return false; } } }