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

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

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

origin: spring-projects/spring-batch

/**
 * Convenience method for calling process skip listener, so that it can be
 * called from multiple places.
 *
 * @param item the item that is skipped
 * @param e the cause of the skip
 */
private void callProcessSkipListener(I item, Throwable e) {
  try {
    getListener().onSkipInProcess(item, 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#onSkipInWrite(java.lang.Object, java.lang.Throwable)}
 * .
 */
@Test
public void testOnSkipInProcess() {
  multicast.register(new SkipListenerSupport<Object,Object>() {
    @Override
    public void onSkipInProcess(Object item, Throwable t) {
      count++;
      super.onSkipInWrite(item, t);
    }
  });
  multicast.onSkipInProcess(null, new RuntimeException("foo"));
  assertEquals(1, count);
}
origin: spring-projects/spring-batch

@Override
public O doWithRetry(RetryContext context) throws Exception {
  try {
    return doTransform(item);
  }
  catch (Exception e) {
    if (shouldSkip(skipPolicy, e, contribution.getStepSkipCount())) {
      // If we are not re-throwing then we should check if
      // this is skippable
      contribution.incrementProcessSkipCount();
      logger.debug("Skipping after failed process with no rollback", e);
      // If not re-throwing then the listener will not be
      // called in next chunk.
      getListener().onSkipInProcess(item, e);
    } else {
      getListener().onRetryProcessException(item, e);
      if (rollbackClassifier.classify(e)) {
        // Default is to rollback unless the classifier
        // allows us to continue
        throw e;
      }
      else {
        throw e;
      }
    }
  }
  return null;
}
origin: spring-projects/spring-batch

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

/**
 * Convenience method for calling process skip listener, so that it can be
 * called from multiple places.
 *
 * @param item the item that is skipped
 * @param e the cause of the skip
 */
private void callProcessSkipListener(I item, Throwable e) {
  try {
    getListener().onSkipInProcess(item, e);
  }
  catch (RuntimeException ex) {
    throw new SkipListenerFailedException("Fatal exception in SkipListener.", ex, e);
  }
}
origin: org.springframework.batch/org.springframework.batch.core

/**
 * Convenience method for calling process skip listener, so that it can be
 * called from multiple places.
 * 
 * @param item the item that is skipped
 * @param e the cause of the skip
 */
private void callProcessSkipListener(I item, Throwable e) {
  try {
    getListener().onSkipInProcess(item, e);
  }
  catch (RuntimeException ex) {
    throw new SkipListenerFailedException("Fatal exception in SkipListener.", ex, e);
  }
}
origin: org.springframework.batch/spring-batch-core

/**
 * Convenience method for calling process skip listener, so that it can be
 * called from multiple places.
 *
 * @param item the item that is skipped
 * @param e the cause of the skip
 */
private void callProcessSkipListener(I item, Throwable e) {
  try {
    getListener().onSkipInProcess(item, e);
  }
  catch (RuntimeException ex) {
    throw new SkipListenerFailedException("Fatal exception in SkipListener.", ex, e);
  }
}
origin: apache/servicemix-bundles

/**
 * Convenience method for calling process skip listener, so that it can be
 * called from multiple places.
 *
 * @param item the item that is skipped
 * @param e the cause of the skip
 */
private void callProcessSkipListener(I item, Throwable e) {
  try {
    getListener().onSkipInProcess(item, e);
  }
  catch (RuntimeException ex) {
    throw new SkipListenerFailedException("Fatal exception in SkipListener.", ex, e);
  }
}
origin: org.springframework.batch/spring-batch-core

@Override
public O doWithRetry(RetryContext context) throws Exception {
  try {
    return doTransform(item);
  }
  catch (Exception e) {
    if (shouldSkip(skipPolicy, e, contribution.getStepSkipCount())) {
      // If we are not re-throwing then we should check if
      // this is skippable
      contribution.incrementProcessSkipCount();
      logger.debug("Skipping after failed process with no rollback", e);
      // If not re-throwing then the listener will not be
      // called in next chunk.
      getListener().onSkipInProcess(item, e);
    } else {
      getListener().onRetryProcessException(item, e);
      if (rollbackClassifier.classify(e)) {
        // Default is to rollback unless the classifier
        // allows us to continue
        throw e;
      }
      else {
        throw e;
      }
    }
  }
  return null;
}
origin: apache/servicemix-bundles

@Override
public O doWithRetry(RetryContext context) throws Exception {
  try {
    return doTransform(item);
  }
  catch (Exception e) {
    if (shouldSkip(skipPolicy, e, contribution.getStepSkipCount())) {
      // If we are not re-throwing then we should check if
      // this is skippable
      contribution.incrementProcessSkipCount();
      logger.debug("Skipping after failed process with no rollback", e);
      // If not re-throwing then the listener will not be
      // called in next chunk.
      getListener().onSkipInProcess(item, e);
    } else {
      getListener().onRetryProcessException(item, e);
      if (rollbackClassifier.classify(e)) {
        // Default is to rollback unless the classifier
        // allows us to continue
        throw e;
      }
      else {
        throw e;
      }
    }
  }
  return null;
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

@Override
public O doWithRetry(RetryContext context) throws Exception {
  try {
    return doTransform(item);
  }
  catch (Exception e) {
    if (shouldSkip(skipPolicy, e, contribution.getStepSkipCount())) {
      // If we are not re-throwing then we should check if
      // this is skippable
      contribution.incrementProcessSkipCount();
      logger.debug("Skipping after failed process with no rollback", e);
      // If not re-throwing then the listener will not be
      // called in next chunk.
      getListener().onSkipInProcess(item, e);
    } else {
      getListener().onRetryProcessException(item, e);
      if (rollbackClassifier.classify(e)) {
        // Default is to rollback unless the classifier
        // allows us to continue
        throw e;
      }
      else {
        throw e;
      }
    }
  }
  return null;
}
org.springframework.batch.core.listenerMulticasterBatchListeneronSkipInProcess

Popular methods of MulticasterBatchListener

  • afterProcess
  • afterRead
  • afterWrite
  • beforeProcess
  • beforeRead
  • beforeWrite
  • onReadError
  • onSkipInRead
  • 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 requests using okhttp
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • Menu (java.awt)
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Option (scala)
  • From CI to AI: The AI layer in your organization
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