*
* @return a new job step
*/
public Step build() {
JobStep step = new JobStep();
step.setName(getName());
super.enhance(step);
if (job != null) {
step.setJob(job);
}
if (jobParametersExtractor != null) {
step.setJobParametersExtractor(jobParametersExtractor);
}
if (jobLauncher == null) {
SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
jobLauncher.setJobRepository(getJobRepository());
try {
jobLauncher.afterPropertiesSet();
}
catch (Exception e) {
throw new StepBuilderException(e);
}
this.jobLauncher = jobLauncher;
}
step.setJobLauncher(jobLauncher);
try {
step.afterPropertiesSet();
}
catch (Exception e) {
throw new StepBuilderException(e);
}
return step;