Tabnine Logo
MulticasterBatchListener.onSkipInRead
Code IndexAdd Tabnine to your IDE (free)

How to use
onSkipInRead
method
in
org.springframework.batch.core.listener.MulticasterBatchListener

Best Java code snippets using org.springframework.batch.core.listener.MulticasterBatchListener.onSkipInRead (Showing top 11 results out of 315)

origin: spring-projects/spring-batch

@Override
public void postProcess(StepContribution contribution, Chunk<I> chunk) {
  for (Exception e : chunk.getErrors()) {
    try {
      getListener().onSkipInRead(e);
    }
    catch (RuntimeException ex) {
      throw new SkipListenerFailedException("Fatal exception in SkipListener.", ex, e);
    }
  }
}
origin: spring-projects/spring-batch

/**
 * Test method for
 * {@link org.springframework.batch.core.listener.MulticasterBatchListener#onSkipInRead(java.lang.Throwable)}
 * .
 */
@Test
public void testOnSkipInRead() {
  multicast.register(new SkipListenerSupport<Object,Object>() {
    @Override
    public void onSkipInRead(Throwable t) {
      count++;
      super.onSkipInRead(t);
    }
  });
  multicast.onSkipInRead(new RuntimeException("foo"));
  assertEquals(1, count);
}
origin: spring-projects/spring-batch

/**
 * Test method for
 * {@link org.springframework.batch.core.listener.MulticasterBatchListener#onSkipInRead(java.lang.Throwable)}
 * .
 */
@Test
public void testOnSkipInReadFails() {
  multicast.register(new SkipListenerSupport<Object,Object>() {
    @Override
    public void onSkipInRead(Throwable t) {
      count++;
      throw new RuntimeException("foo");
    }
  });
  try {
    multicast.onSkipInRead(new RuntimeException("bar"));
    fail("Expected RuntimeException");
  }
  catch (RuntimeException e) {
    // expected
    String message = e.getMessage();
    assertEquals("Wrong message: " + message, "foo", message);
  }
  assertEquals(1, count);
}
origin: spring-projects/spring-batch

  @Override
  public I doWithRetry(RetryContext arg0) throws Exception {
    while (true) {
      try {
        return doProvide(contribution, chunk);
      }
      catch (Exception e) {
        if (shouldSkip(skipPolicy, e, contribution.getStepSkipCount())) {
          // increment skip count and try again
          contribution.incrementReadSkipCount();
          chunk.skip(e);
          getListener().onSkipInRead(e);
          logger.debug("Skipping failed input", e);
        }
        else {
          getListener().onRetryReadException(e);
          if(rollbackClassifier.classify(e)) {
            throw e;
          }
          else {
            throw e;
          }
        }
      }
    }
  }
};
origin: org.springframework.batch/spring-batch-core

@Override
public void postProcess(StepContribution contribution, Chunk<I> chunk) {
  for (Exception e : chunk.getErrors()) {
    try {
      getListener().onSkipInRead(e);
    }
    catch (RuntimeException ex) {
      throw new SkipListenerFailedException("Fatal exception in SkipListener.", ex, e);
    }
  }
}
origin: org.springframework.batch/org.springframework.batch.core

@Override
public void postProcess(StepContribution contribution, Chunk<I> chunk) {
  for (Exception e : chunk.getErrors()) {
    try {
      getListener().onSkipInRead(e);
    }
    catch (RuntimeException ex) {
      throw new SkipListenerFailedException("Fatal exception in SkipListener.", ex, e);
    }
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

@Override
public void postProcess(StepContribution contribution, Chunk<I> chunk) {
  for (Exception e : chunk.getErrors()) {
    try {
      getListener().onSkipInRead(e);
    }
    catch (RuntimeException ex) {
      throw new SkipListenerFailedException("Fatal exception in SkipListener.", ex, e);
    }
  }
}
origin: apache/servicemix-bundles

@Override
public void postProcess(StepContribution contribution, Chunk<I> chunk) {
  for (Exception e : chunk.getErrors()) {
    try {
      getListener().onSkipInRead(e);
    }
    catch (RuntimeException ex) {
      throw new SkipListenerFailedException("Fatal exception in SkipListener.", ex, e);
    }
  }
}
origin: org.springframework.batch/spring-batch-core

  @Override
  public I doWithRetry(RetryContext arg0) throws Exception {
    while (true) {
      try {
        return doProvide(contribution, chunk);
      }
      catch (Exception e) {
        if (shouldSkip(skipPolicy, e, contribution.getStepSkipCount())) {
          // increment skip count and try again
          contribution.incrementReadSkipCount();
          chunk.skip(e);
          getListener().onSkipInRead(e);
          logger.debug("Skipping failed input", e);
        }
        else {
          getListener().onRetryReadException(e);
          if(rollbackClassifier.classify(e)) {
            throw e;
          }
          else {
            throw e;
          }
        }
      }
    }
  }
};
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

  @Override
  public I doWithRetry(RetryContext arg0) throws Exception {
    while (true) {
      try {
        return doProvide(contribution, chunk);
      }
      catch (Exception e) {
        if (shouldSkip(skipPolicy, e, contribution.getStepSkipCount())) {
          // increment skip count and try again
          contribution.incrementReadSkipCount();
          chunk.skip(e);
          getListener().onSkipInRead(e);
          logger.debug("Skipping failed input", e);
        }
        else {
          getListener().onRetryReadException(e);
          if(rollbackClassifier.classify(e)) {
            throw e;
          }
          else {
            throw e;
          }
        }
      }
    }
  }
};
origin: apache/servicemix-bundles

  @Override
  public I doWithRetry(RetryContext arg0) throws Exception {
    while (true) {
      try {
        return doProvide(contribution, chunk);
      }
      catch (Exception e) {
        if (shouldSkip(skipPolicy, e, contribution.getStepSkipCount())) {
          // increment skip count and try again
          contribution.incrementReadSkipCount();
          chunk.skip(e);
          getListener().onSkipInRead(e);
          logger.debug("Skipping failed input", e);
        }
        else {
          getListener().onRetryReadException(e);
          if(rollbackClassifier.classify(e)) {
            throw e;
          }
          else {
            throw e;
          }
        }
      }
    }
  }
};
org.springframework.batch.core.listenerMulticasterBatchListeneronSkipInRead

Popular methods of MulticasterBatchListener

  • afterProcess
  • afterRead
  • afterWrite
  • beforeProcess
  • beforeRead
  • beforeWrite
  • onReadError
  • onSkipInProcess
  • onSkipInWrite
  • onWriteError
  • register
    Register the listener for callbacks on the appropriate interfaces implemented. Any StepListener can
  • onProcessError
  • register,
  • onProcessError,
  • onRetryProcessException,
  • onRetryReadException,
  • onRetryWriteException,
  • getTargetException,
  • afterChunk,
  • afterStep,
  • beforeChunk

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now