commit
This commit is contained in:
@@ -79,6 +79,8 @@ public abstract class AbstractBatchTask implements AbstractBatch, ApplicationCon
|
||||
*/
|
||||
private PlatformTransactionManager transactionManager;
|
||||
|
||||
private BatchExceptionListener batchExceptionListener;
|
||||
|
||||
/**
|
||||
* 기본 생성자입니다.
|
||||
*
|
||||
@@ -163,6 +165,11 @@ public abstract class AbstractBatchTask implements AbstractBatch, ApplicationCon
|
||||
this.transactionManager = transactionManager;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public void setBatchExceptionListener(BatchExceptionListener batchExceptionListener) {
|
||||
this.batchExceptionListener = batchExceptionListener;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치 작업을 생성합니다.
|
||||
*
|
||||
@@ -180,6 +187,7 @@ public abstract class AbstractBatchTask implements AbstractBatch, ApplicationCon
|
||||
var jobBuilder = new JobBuilder(batchJobInfoData.getJobName())
|
||||
.incrementer(new RunIdIncrementer())
|
||||
.repository(jobRepository)
|
||||
.listener(batchExceptionListener)
|
||||
.start(steps.get(0));
|
||||
for (int i = 1; i < steps.size(); i++) {
|
||||
jobBuilder = jobBuilder.next(steps.get(i));
|
||||
@@ -213,6 +221,7 @@ public abstract class AbstractBatchTask implements AbstractBatch, ApplicationCon
|
||||
return new StepBuilder(stepName)
|
||||
.repository(jobRepository)
|
||||
.transactionManager(transactionManager)
|
||||
.listener(batchExceptionListener)
|
||||
.tasklet(tasklet)
|
||||
.build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user