SpringBatch batch framework --- Chunk interceptor

3232.jpg

Chunk operation provides a wealth of interceptor mechanism, interceptor additional control capability can be achieved, such as logging, task tracking, status reporting capabilities, data transfer, etc.,

In the process SpringBatch in, keep it simple business as much as possible, the need for any additional processing functions implemented in the interceptor


                                                               Chunk Interceptor Interface

image.png



 Chunk interceptor scope:                              


     JobExecutionListener                           


   StepExecutionListener                       


         Tasklet                                           


         ChunkListner                                 


  ItemReadListener                                   


  ItemProcessListener


 ItemWriteListener


2526.jpg


Chunk interceptor implementation of the order:


JobExecutionListener .beforeJob()


StepExecutionListener.beforeStep()


ChunkListener.beforeChunk()


ItemReadListener.beforeRead()


ItemReadListener.afterRead()


ItemProcessListener.beforeProcess()


ItemProcessListener.afterProess()


ItemWriteListener.beforeWrite()      


ItemWriteListener.afterWrite()


ChunListener.afterChunk()


StepExecutionListener.afterStep()


 JobExecutionListener .afterJob()                                  


Guess you like

Origin blog.51cto.com/14028890/2417699