我正在使用spring MVC.从我的控制器,我正在调用,jobLauncher并在jobLauncher我传递如下的工作参数,我正在使用注释来启用配置如下:
@Configuration
@EnableBatchProcessing
public class BatchConfiguration {
// read, write ,process and invoke job
}
JobParameters jobParameters = new JobParametersBuilder().addString("fileName", "xxxx.txt").toJobParameters();
stasrtjob = jobLauncher.run(job, jobParameters);
and here is my itemprocessor
public class DataItemProcessor implements ItemProcessor<InputData, OutPutData> {
public OutPutData process(final InputData inputData) throws Exception {
// i want to get job Parameters here ????
}
}
Run Code Online (Sandbox Code Playgroud)