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

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

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

origin: spring-projects/spring-batch

/**
 * Surrounds the read call with listener callbacks.
 * @return the item or {@code null} if the data source is exhausted
 * @throws Exception is thrown if error occurs during read.
 */
@Nullable
protected final I doRead() throws Exception {
  try {
    listener.beforeRead();
    I item = itemReader.read();
    if(item != null) {
      listener.afterRead(item);
    }
    return item;
  }
  catch (Exception e) {
    if (logger.isDebugEnabled()) {
      logger.debug(e.getMessage() + " : " + e.getClass().getName());
    }
    listener.onReadError(e);
    throw e;
  }
}
origin: spring-projects/spring-batch

/**
 * Implements reading as well as any related listener calls required.
 *
 * @param contribution a {@link StepContribution}
 * @param chunk a {@link Chunk}
 * @return an item
 * @throws Exception thrown if error occurs during reading or listener calls.
 */
protected final I doProvide(final StepContribution contribution, final Chunk<I> chunk) throws Exception {
  try {
    listener.beforeRead();
    I item = itemReader.read();
    if(item != null) {
      listener.afterRead(item);
    } else {
      chunk.setEnd();
    }
    return item;
  }
  catch (Exception e) {
    if (logger.isDebugEnabled()) {
      logger.debug(e.getMessage() + " : " + e.getClass().getName());
    }
    listener.onReadError(e);
    throw e;
  }
}
origin: spring-projects/spring-batch

/**
 * Test method for
 * {@link org.springframework.batch.core.listener.MulticasterBatchListener#onReadError(java.lang.Exception)}
 * .
 */
@Test
public void testOnReadError() {
  multicast.onReadError(new RuntimeException("foo"));
  assertEquals(1, count);
}
origin: spring-projects/spring-batch

/**
 * Test method for
 * {@link org.springframework.batch.core.listener.MulticasterBatchListener#onReadError(java.lang.Exception)}
 * .
 */
@Test
public void testOnReadErrorFails() {
  error = true;
  try {
    multicast.onReadError(new RuntimeException("foo"));
    fail("Expected StepListenerFailedException");
  }
  catch (StepListenerFailedException e) {
    // expected
    String message = e.getCause().getMessage();
    assertEquals("Wrong message: " + message, "listener error", message);
  }
  assertEquals(1, count);
}
origin: org.springframework.batch/spring-batch-core

/**
 * Surrounds the read call with listener callbacks.
 * @return the item or {@code null} if the data source is exhausted
 * @throws Exception is thrown if error occurs during read.
 */
@Nullable
protected final I doRead() throws Exception {
  try {
    listener.beforeRead();
    I item = itemReader.read();
    if(item != null) {
      listener.afterRead(item);
    }
    return item;
  }
  catch (Exception e) {
    if (logger.isDebugEnabled()) {
      logger.debug(e.getMessage() + " : " + e.getClass().getName());
    }
    listener.onReadError(e);
    throw e;
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

/**
 * Surrounds the read call with listener callbacks.
 * @return item
 * @throws Exception
 */
protected final I doRead() throws Exception {
  try {
    listener.beforeRead();
    I item = itemReader.read();
    if(item != null) {
      listener.afterRead(item);
    }
    return item;
  }
  catch (Exception e) {
    logger.debug(e.getMessage() + " : " + e.getClass().getName());
    listener.onReadError(e);
    throw e;
  }
}
origin: apache/servicemix-bundles

/**
 * Surrounds the read call with listener callbacks.
 * @return the item or {@code null} if the data source is exhausted
 * @throws Exception is thrown if error occurs during read.
 */
@Nullable
protected final I doRead() throws Exception {
  try {
    listener.beforeRead();
    I item = itemReader.read();
    if(item != null) {
      listener.afterRead(item);
    }
    return item;
  }
  catch (Exception e) {
    if (logger.isDebugEnabled()) {
      logger.debug(e.getMessage() + " : " + e.getClass().getName());
    }
    listener.onReadError(e);
    throw e;
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

/**
 * Implements reading as well as any related listener calls required.
 *
 * @param contribution a {@link StepContribution}
 * @param chunk a {@link Chunk}
 * @return an item
 * @throws Exception
 */
protected final I doProvide(final StepContribution contribution, final Chunk<I> chunk) throws Exception {
  try {
    listener.beforeRead();
    I item = itemReader.read();
    if(item != null) {
      listener.afterRead(item);
    } else {
      chunk.setEnd();
    }
    return item;
  }
  catch (Exception e) {
    logger.debug(e.getMessage() + " : " + e.getClass().getName());
    listener.onReadError(e);
    throw e;
  }
}
origin: org.springframework.batch/spring-batch-core

/**
 * Implements reading as well as any related listener calls required.
 *
 * @param contribution a {@link StepContribution}
 * @param chunk a {@link Chunk}
 * @return an item
 * @throws Exception thrown if error occurs during reading or listener calls.
 */
protected final I doProvide(final StepContribution contribution, final Chunk<I> chunk) throws Exception {
  try {
    listener.beforeRead();
    I item = itemReader.read();
    if(item != null) {
      listener.afterRead(item);
    } else {
      chunk.setEnd();
    }
    return item;
  }
  catch (Exception e) {
    if (logger.isDebugEnabled()) {
      logger.debug(e.getMessage() + " : " + e.getClass().getName());
    }
    listener.onReadError(e);
    throw e;
  }
}
origin: apache/servicemix-bundles

/**
 * Implements reading as well as any related listener calls required.
 *
 * @param contribution a {@link StepContribution}
 * @param chunk a {@link Chunk}
 * @return an item
 * @throws Exception thrown if error occurs during reading or listener calls.
 */
protected final I doProvide(final StepContribution contribution, final Chunk<I> chunk) throws Exception {
  try {
    listener.beforeRead();
    I item = itemReader.read();
    if(item != null) {
      listener.afterRead(item);
    } else {
      chunk.setEnd();
    }
    return item;
  }
  catch (Exception e) {
    if (logger.isDebugEnabled()) {
      logger.debug(e.getMessage() + " : " + e.getClass().getName());
    }
    listener.onReadError(e);
    throw e;
  }
}
origin: org.springframework.batch/org.springframework.batch.core

/**
 * Surrounds the read call with listener callbacks.
 * @return item
 * @throws Exception
 */
protected final I doRead() throws Exception {
  try {
    listener.beforeRead();
    I item = itemReader.read();
    listener.afterRead(item);
    return item;
  }
  catch (Exception e) {
    listener.onReadError(e);
    throw e;
  }
}
org.springframework.batch.core.listenerMulticasterBatchListeneronReadError

Popular methods of MulticasterBatchListener

  • afterProcess
  • afterRead
  • afterWrite
  • beforeProcess
  • beforeRead
  • beforeWrite
  • onSkipInProcess
  • 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

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Permission (java.security)
    Legacy security code; do not use.
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JLabel (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • CodeWhisperer 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