private RepeatOperations createRepeatOperations() { RepeatTemplate repeatOperations = new RepeatTemplate(); repeatOperations.setCompletionPolicy(getChunkCompletionPolicy()); repeatOperations.setExceptionHandler(getExceptionHandler()); return repeatOperations; } }
SimpleRetryExceptionHandler exceptionHandler = new SimpleRetryExceptionHandler(retryPolicyWrapper, getExceptionHandler(), nonRetryableExceptionClasses); ((RepeatTemplate) stepOperations).setExceptionHandler(exceptionHandler);
/** * Check that the exception handler is called. * * @throws Exception */ @Test public void testExceptionHandlerCalledOnAbnormalCompletion() throws Exception { final List<Throwable> list = new ArrayList<>(); template.setExceptionHandler(new ExceptionHandler() { @Override public void handleException(RepeatContext context, Throwable throwable) throws RuntimeException { list.add(throwable); throw (RuntimeException) throwable; } }); try { template.iterate(new RepeatCallback() { @Override public RepeatStatus doInIteration(RepeatContext context) throws Exception { count++; throw new RuntimeException("foo"); } }); } catch (RuntimeException e) { assertEquals("foo", e.getMessage()); } assertEquals(1, count); assertEquals(1, list.size()); }
((RepeatTemplate) stepOperations).setExceptionHandler(exceptionHandler);
((RepeatTemplate) getStepOperations()).setExceptionHandler(getExceptionHandler());
((RepeatTemplate) getStepOperations()).setExceptionHandler(getExceptionHandler());
((RepeatTemplate) getStepOperations()).setExceptionHandler(getExceptionHandler());
template.setExceptionHandler(exHandler); template.setListeners(new RepeatListener[] { listener });
private RepeatOperations createRepeatOperations() { RepeatTemplate repeatOperations = new RepeatTemplate(); repeatOperations.setCompletionPolicy(getChunkCompletionPolicy()); repeatOperations.setExceptionHandler(getExceptionHandler()); return repeatOperations; } }
private RepeatOperations createRepeatOperations() { RepeatTemplate repeatOperations = new RepeatTemplate(); repeatOperations.setCompletionPolicy(getChunkCompletionPolicy()); repeatOperations.setExceptionHandler(getExceptionHandler()); return repeatOperations; } }
private RepeatOperations createRepeatOperations() { RepeatTemplate repeatOperations = new RepeatTemplate(); repeatOperations.setCompletionPolicy(getChunkCompletionPolicy()); repeatOperations.setExceptionHandler(getExceptionHandler()); return repeatOperations; } }
SimpleRetryExceptionHandler exceptionHandler = new SimpleRetryExceptionHandler(retryPolicyWrapper, getExceptionHandler(), nonRetryableExceptionClasses); ((RepeatTemplate) stepOperations).setExceptionHandler(exceptionHandler);
((RepeatTemplate) stepOperations).setExceptionHandler(exceptionHandler);
((RepeatTemplate) stepOperations).setExceptionHandler(exceptionHandler);
((RepeatTemplate) stepOperations).setExceptionHandler(exceptionHandler);
((RepeatTemplate) stepOperations).setExceptionHandler(exceptionHandler);
((RepeatTemplate) getStepOperations()).setExceptionHandler(getExceptionHandler());
((RepeatTemplate) getStepOperations()).setExceptionHandler(getExceptionHandler());
((RepeatTemplate) getStepOperations()).setExceptionHandler(getExceptionHandler());
((RepeatTemplate) getStepOperations()).setExceptionHandler(getExceptionHandler());