/** * Delegates to an exception classifier. * * @param ex * @return true if this exception or its ancestors have been registered as * retryable. */ private boolean retryForException(Throwable ex) { return retryableClassifier.classify(ex); }
@Override public boolean rollbackOn(Throwable ex) { return classifier.classify(ex); } });
/** * Check if the exception is going to be retried, and veto the handling if * it is. If retry is exhausted or the exception is on the fatal list, then * handle using the delegate. * * @see ExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, * java.lang.Throwable) */ @Override public void handleException(RepeatContext context, Throwable throwable) throws Throwable { // Only bother to check the delegate exception handler if we know that // retry is exhausted if (fatalExceptionClassifier.classify(throwable) || context.hasAttribute(EXHAUSTED)) { logger.debug("Handled fatal exception"); exceptionHandler.handleException(context, throwable); } else { logger.debug("Handled non-fatal exception", throwable); } }
@Override public boolean rollbackOn(Throwable ex) { return classifier.classify(ex); } });
/** * Delegates to an exception classifier. * * @param ex * @return true if this exception or its ancestors have been registered as * retryable. */ private boolean retryForException(Throwable ex) { return retryableClassifier.classify(ex); }
@Override public boolean rollbackOn(Throwable ex) { return classifier.classify(ex); } });
@Override public boolean rollbackOn(Throwable ex) { return classifier.classify(ex); } });
private boolean isRetryAbleException(Throwable throwable) { boolean retryAble = this.binaryExceptionClassifier.classify(throwable); if (!retryAble) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Retry on Exception: {} not possible trying cause", throwable.getClass().getName()); } if (throwable.getCause() != null) { return isRetryAbleException(throwable.getCause()); } return false; } else { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Retry possible due to exception class {}", throwable.getClass().getName()); } return true; } }
private boolean isRetryAbleException(Throwable throwable) { boolean retryAble = this.binaryExceptionClassifier.classify(throwable); if (!retryAble) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Retry on Exception: {} not possible trying cause", throwable.getClass().getName()); } if (throwable.getCause() != null) { return isRetryAbleException(throwable.getCause()); } return false; } else { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Retry possible due to exception class {}", throwable.getClass().getName()); } return true; } }
/** * Check if the exception is going to be retried, and veto the handling if * it is. If retry is exhausted or the exception is on the fatal list, then * handle using the delegate. * * @see ExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, * java.lang.Throwable) */ @Override public void handleException(RepeatContext context, Throwable throwable) throws Throwable { // Only bother to check the delegate exception handler if we know that // retry is exhausted if (fatalExceptionClassifier.classify(throwable) || context.hasAttribute(EXHAUSTED)) { logger.debug("Handled fatal exception"); exceptionHandler.handleException(context, throwable); } else { logger.debug("Handled non-fatal exception", throwable); } }
/** * Check if the exception is going to be retried, and veto the handling if * it is. If retry is exhausted or the exception is on the fatal list, then * handle using the delegate. * * @see ExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, * java.lang.Throwable) */ @Override public void handleException(RepeatContext context, Throwable throwable) throws Throwable { // Only bother to check the delegate exception handler if we know that // retry is exhausted if (fatalExceptionClassifier.classify(throwable) || context.hasAttribute(EXHAUSTED)) { logger.debug("Handled fatal exception"); exceptionHandler.handleException(context, throwable); } else { logger.debug("Handled non-fatal exception", throwable); } }
/** * Check if the exception is going to be retried, and veto the handling if * it is. If retry is exhausted or the exception is on the fatal list, then * handle using the delegate. * * @see ExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, * java.lang.Throwable) */ @Override public void handleException(RepeatContext context, Throwable throwable) throws Throwable { // Only bother to check the delegate exception handler if we know that // retry is exhausted if (fatalExceptionClassifier.classify(throwable) || context.hasAttribute(EXHAUSTED)) { logger.debug("Handled fatal exception"); exceptionHandler.handleException(context, throwable); } else { logger.debug("Handled non-fatal exception", throwable); } }