Package org.springframework.batch.repeat.exception

Examples of org.springframework.batch.repeat.exception.SimpleLimitExceptionHandler


  @Test
  public void testExceptionHandler() throws Exception {
    SimpleStepFactoryBean<String, String> factory = getStepFactory(new String[] { "foo", "bar", "spam" });
    factory.setBeanName("exceptionStep");
    SimpleLimitExceptionHandler exceptionHandler = new SimpleLimitExceptionHandler(1);
    exceptionHandler.afterPropertiesSet();
    factory.setExceptionHandler(exceptionHandler);
    factory.setItemWriter(new ItemWriter<String>() {
      int count = 0;

      @Override
View Full Code Here


  private SimpleRetryExceptionHandler getHandlerAfterRetry(RetryPolicy retryPolicy, RuntimeException ex,
      Collection<Class<? extends Throwable>> fatalExceptions) {

    // Always rethrow if the retry is exhausted
    SimpleRetryExceptionHandler handler = new SimpleRetryExceptionHandler(retryPolicy,
        new SimpleLimitExceptionHandler(0), fatalExceptions);

    // Simulate a failed retry...
    RetryContext retryContext = retryPolicy.open(null);
    retryPolicy.registerThrowable(retryContext, ex);
    handler.close(retryContext, null, ex);
View Full Code Here

TOP

Related Classes of org.springframework.batch.repeat.exception.SimpleLimitExceptionHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.