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

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

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

origin: spring-projects/spring-batch

/**
 * Call listener's writerError method.
 * @param e exception that occurred.
 * @param items list of items that failed to be written.
 */
protected final void doOnWriteError(Exception e, List<O> items) {
  listener.onWriteError(e, items);
}
origin: spring-projects/spring-batch

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

  /**
   * Implements writing and all related listener calls
   *
   * @param contribution a {@link StepContribution}
   * @param chunk a {@link Chunk}
   * @throws Exception thrown if error occurs during the writing portion of the chunking loop.
   */
  protected final void doPersist(final StepContribution contribution, final Chunk<O> chunk) throws Exception {
    try {
      List<O> items = chunk.getItems();
      listener.beforeWrite(items);
      itemWriter.write(items);
      listener.afterWrite(items);
    }
    catch (Exception e) {
      listener.onWriteError(e, chunk.getItems());
      throw e;
    }
  }
}
origin: spring-projects/spring-batch

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

/**
 * Call listener's writerError method.
 * @param e exception that occurred.
 * @param items list of items that failed to be written.
 */
protected final void doOnWriteError(Exception e, List<O> items) {
  listener.onWriteError(e, items);
}
origin: org.springframework.batch/spring-batch-core

/**
 * Call listener's writerError method.
 * @param e exception that occurred.
 * @param items list of items that failed to be written.
 */
protected final void doOnWriteError(Exception e, List<O> items) {
  listener.onWriteError(e, items);
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

protected final void doOnWriteError(Exception e, List<O> items) {
  listener.onWriteError(e, items);
}
origin: org.springframework.batch/org.springframework.batch.core

/**
 * Surrounds the actual write call with listener callbacks.
 * 
 * @param items
 * @throws Exception
 */
protected final void doWrite(List<O> items) throws Exception {
  if (itemWriter==null) {
    return;
  }
  try {
    listener.beforeWrite(items);
    writeItems(items);
    doAfterWrite(items);
  }
  catch (Exception e) {
    listener.onWriteError(e, items);
    throw e;
  }
}
origin: org.springframework.batch/spring-batch-core

  /**
   * Implements writing and all related listener calls
   *
   * @param contribution a {@link StepContribution}
   * @param chunk a {@link Chunk}
   * @throws Exception thrown if error occurs during the writing portion of the chunking loop.
   */
  protected final void doPersist(final StepContribution contribution, final Chunk<O> chunk) throws Exception {
    try {
      List<O> items = chunk.getItems();
      listener.beforeWrite(items);
      itemWriter.write(items);
      listener.afterWrite(items);
    }
    catch (Exception e) {
      listener.onWriteError(e, chunk.getItems());
      throw e;
    }
  }
}
origin: apache/servicemix-bundles

  /**
   * Implements writing and all related listener calls
   *
   * @param contribution a {@link StepContribution}
   * @param chunk a {@link Chunk}
   * @throws Exception thrown if error occurs during the writing portion of the chunking loop.
   */
  protected final void doPersist(final StepContribution contribution, final Chunk<O> chunk) throws Exception {
    try {
      List<O> items = chunk.getItems();
      listener.beforeWrite(items);
      itemWriter.write(items);
      listener.afterWrite(items);
    }
    catch (Exception e) {
      listener.onWriteError(e, chunk.getItems());
      throw e;
    }
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

  /**
   * Implements writing and all related listener calls
   *
   * @param contribution a {@link StepContribution}
   * @param chunk a {@link Chunk}
   * @throws Exception
   */
  protected final void doPersist(final StepContribution contribution, final Chunk<O> chunk) throws Exception {
    try {
      List<O> items = chunk.getItems();
      listener.beforeWrite(items);
      itemWriter.write(items);
      listener.afterWrite(items);
    }
    catch (Exception e) {
      listener.onWriteError(e, chunk.getItems());
      throw e;
    }
  }
}
org.springframework.batch.core.listenerMulticasterBatchListeneronWriteError

Popular methods of MulticasterBatchListener

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

  • Reactive rest calls using spring rest template
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • addToBackStack (FragmentTransaction)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top plugins for WebStorm
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