Package org.springframework.batch.core

Examples of org.springframework.batch.core.StepExecutionListener


      if(listener instanceof SkipWriteListener) {
        SkipListener<I, O> skipListener = new SkipListenerAdapter<I, O>(null, null, (SkipWriteListener) listener);
        skipListeners.add(skipListener);
      }
      if (listener instanceof StepExecutionListener) {
        StepExecutionListener stepExecutionListener = (StepExecutionListener) listener;
        stepExecutionListeners.add(stepExecutionListener);
      }
      if(listener instanceof javax.batch.api.listener.StepListener) {
        StepExecutionListener stepExecutionListener = new StepListenerAdapter((javax.batch.api.listener.StepListener) listener);
        stepExecutionListeners.add(stepExecutionListener);
      }
      if (listener instanceof ChunkListener) {
        ChunkListener chunkListener = (ChunkListener) listener;
        chunkListeners.add(chunkListener);
View Full Code Here


   * doesn't cause step failure.
   * @throws JobInterruptedException
   */
  @Test
  public void testStepFailureInAfterStepCallback() throws JobInterruptedException {
    StepExecutionListener listener = new StepExecutionListenerSupport() {
      @Override
      public ExitStatus afterStep(StepExecution stepExecution) {
        throw new RuntimeException("exception thrown in afterStep to signal failure");
      }
    };
View Full Code Here

   * @see org.springframework.batch.core.StepExecutionListener#afterStep(StepExecution)
   */
  @Override
  public ExitStatus afterStep(StepExecution stepExecution) {
    for (Iterator<StepExecutionListener> iterator = list.reverse(); iterator.hasNext();) {
      StepExecutionListener listener = iterator.next();
      ExitStatus close = listener.afterStep(stepExecution);
      stepExecution.setExitStatus(stepExecution.getExitStatus().and(close));
    }
    return stepExecution.getExitStatus();
  }
View Full Code Here

   * @see org.springframework.batch.core.StepExecutionListener#beforeStep(StepExecution)
   */
  @Override
  public void beforeStep(StepExecution stepExecution) {
    for (Iterator<StepExecutionListener> iterator = list.iterator(); iterator.hasNext();) {
      StepExecutionListener listener = iterator.next();
      listener.beforeStep(stepExecution);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.StepExecutionListener

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.