jbatch3

几个有用的url

  • https://jberet.gitbooks.io/jberet-user-guide/content/batch_properties/index.html
  • http://kagamihoge.hatenablog.com/entry/2014/04/10/205918

listener


 
    
        
    
     
    
        
            
        
        
    
    


job 和step都可以有自己listener
只要分别继承AbstractJobListener 或者AbstractStepListener就可以
或者应用接口也可以
但是也就4个方法 beforeJob afterJob beforeStep afterStep

JobContext和StepContext

里面有一些关于这个batch的相关信息,譬如name,executionId,status等

要注意的是,在JobContext中,即使在listener中的afterJob中得到status,也是started而不是completed,详细解释无非是认为只要还在运行,就没结束 https://stackoverflow.com/questions/48311434/jsr-352-java-batch-why-does-joblistener-afterjob-always-get-batch-status-star

你可能感兴趣的:(jbatch3)