11 Kasım 2018 Pazar

SpringBatch StepExecutionListener Arayüzü

afterStep metodu
Şöyle yaparız.
public class DataReader implements Tasklet, StepExecutionListener {

  @Override
  public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext)
  throws Exception {        
    ...
    return RepeatStatus.FINISHED;
  }

  @Override
  public void beforeStep(StepExecution stepExecution) {
  }

  @Override
  public ExitStatus afterStep(StepExecution stepExecution) {
    stepExecution.getJobExecution().getExecutionContext()
      .put("entityDataDTO", this.entityDataDTO); 
    return ExitStatus.COMPLETED;
  }
}
beforeStep metodu
İmzası şöyle
public void beforeStep(StepExecution stepExecution);


Hiç yorum yok:

Yorum Gönder