public void init() throws Exception {
context.register(BatchConfiguration.class);
context.refresh();
JobRepository jobRepository = context.getBean(JobRepository.class);
jobLauncher = context.getBean(JobLauncher.class);
jobs = new JobBuilderFactory(jobRepository);
PlatformTransactionManager transactionManager = this.context.getBean(PlatformTransactionManager.class);
steps = new StepBuilderFactory(jobRepository, transactionManager);
step = steps.get("step").tasklet(new Tasklet() {
@Override
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {