Package org.springframework.batch.repeat.exception

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


  }

  public void testDelegation() throws Throwable {
    final List<String> list = new ArrayList<String>();
    handler.setHandlers(new ExceptionHandler[] {
      new ExceptionHandler() {
                @Override
        public void handleException(RepeatContext context, Throwable throwable) throws RuntimeException {
          list.add("1");
        }
      },
      new ExceptionHandler() {
                @Override
        public void handleException(RepeatContext context, Throwable throwable) throws RuntimeException {
          list.add("2");
        }
      }
View Full Code Here


  @Test
  public void testExceptionHandlerCalledOnAbnormalCompletion() throws Exception {

    final List<Throwable> list = new ArrayList<Throwable>();

    template.setExceptionHandler(new ExceptionHandler() {
            @Override
      public void handleException(RepeatContext context, Throwable throwable) throws RuntimeException {
        list.add(throwable);
        throw (RuntimeException) throwable;
      }
View Full Code Here

    SimpleAsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
    template.setCompletionPolicy(new SimpleCompletionPolicy(4));
    taskExecutor.setConcurrencyLimit(2);
    template.setTaskExecutor(taskExecutor);

    template.setExceptionHandler(new ExceptionHandler() {
            @Override
      public void handleException(RepeatContext context, Throwable throwable) throws Throwable {
        count++;
      }
    });
View Full Code Here

TOP

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

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.