|
|
|
|
@ -1,25 +1,17 @@
|
|
|
|
|
package kr.xit.batch.ens.job;
|
|
|
|
|
|
|
|
|
|
import org.springframework.batch.core.Job;
|
|
|
|
|
import org.springframework.batch.core.Step;
|
|
|
|
|
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
|
|
|
|
|
import org.springframework.batch.core.configuration.annotation.JobScope;
|
|
|
|
|
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.batch.core.*;
|
|
|
|
|
import org.springframework.batch.core.configuration.annotation.*;
|
|
|
|
|
import org.springframework.beans.factory.annotation.*;
|
|
|
|
|
import org.springframework.context.annotation.*;
|
|
|
|
|
|
|
|
|
|
import kr.xit.batch.ens.task.KtGbsAccessTokenUpdateTasklet;
|
|
|
|
|
import kr.xit.biz.ens.service.IEnsBatchKtGbsAccessTokenUpdateService;
|
|
|
|
|
import kr.xit.core.biz.batch.CustomRunIdIncrementer;
|
|
|
|
|
import kr.xit.core.biz.batch.listener.CustomJobListener;
|
|
|
|
|
import kr.xit.core.biz.batch.listener.CustomStepListener;
|
|
|
|
|
import kr.xit.core.biz.batch.listener.NoWorkFoundStepListener;
|
|
|
|
|
import kr.xit.core.biz.batch.service.IBatchCmmService;
|
|
|
|
|
import kr.xit.core.biz.batch.task.BatchEndTasklet;
|
|
|
|
|
import kr.xit.core.biz.batch.task.BatchFailEndTasklet;
|
|
|
|
|
import kr.xit.core.biz.batch.task.BatchStartTasklet;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import kr.xit.batch.ens.task.*;
|
|
|
|
|
import kr.xit.biz.ens.service.*;
|
|
|
|
|
import kr.xit.core.biz.batch.*;
|
|
|
|
|
import kr.xit.core.biz.batch.listener.*;
|
|
|
|
|
import kr.xit.core.biz.batch.service.*;
|
|
|
|
|
import kr.xit.core.biz.batch.task.*;
|
|
|
|
|
import lombok.extern.slf4j.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <pre>
|
|
|
|
|
@ -37,17 +29,20 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
* </pre>
|
|
|
|
|
*/
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
@Configuration
|
|
|
|
|
public class KtGbsAccessTokenUpdateJobConfig {
|
|
|
|
|
private static final String JOB_NAME = "ktGbsAccessTokenUpdateJob";
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
|
|
|
|
|
private final JobBuilderFactory jobBuilderFactory;
|
|
|
|
|
private final StepBuilderFactory stepBuilderFactory;
|
|
|
|
|
@Autowired
|
|
|
|
|
private JobBuilderFactory jobBuilderFactory;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StepBuilderFactory stepBuilderFactory;
|
|
|
|
|
|
|
|
|
|
private final IBatchCmmService lockService;
|
|
|
|
|
private final IEnsBatchKtGbsAccessTokenUpdateService service;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IBatchCmmService batchCmmService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IEnsBatchKtGbsAccessTokenUpdateService service;
|
|
|
|
|
|
|
|
|
|
@Bean(name = JOB_NAME)
|
|
|
|
|
public Job ktGbsAccessTokenUpdateJob() {
|
|
|
|
|
@ -92,7 +87,7 @@ public class KtGbsAccessTokenUpdateJobConfig {
|
|
|
|
|
@Bean(name = JOB_NAME + "_start_step")
|
|
|
|
|
protected Step start() {
|
|
|
|
|
return stepBuilderFactory.get("Job_Locking")
|
|
|
|
|
.tasklet(new BatchStartTasklet(lockService))
|
|
|
|
|
.tasklet(new BatchStartTasklet(batchCmmService))
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -100,7 +95,7 @@ public class KtGbsAccessTokenUpdateJobConfig {
|
|
|
|
|
@Bean(name = JOB_NAME + "_end_step")
|
|
|
|
|
protected Step end() {
|
|
|
|
|
return stepBuilderFactory.get("Lock_Release")
|
|
|
|
|
.tasklet(new BatchEndTasklet(lockService))
|
|
|
|
|
.tasklet(new BatchEndTasklet(batchCmmService))
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -108,7 +103,7 @@ public class KtGbsAccessTokenUpdateJobConfig {
|
|
|
|
|
@Bean(name = JOB_NAME + "_fail_step")
|
|
|
|
|
protected Step fail() {
|
|
|
|
|
return stepBuilderFactory.get("Lock_Release")
|
|
|
|
|
.tasklet(new BatchFailEndTasklet(lockService))
|
|
|
|
|
.tasklet(new BatchFailEndTasklet(batchCmmService))
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|