You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
583 B
Groovy
34 lines
583 B
Groovy
12 years ago
|
package org.test
|
||
|
|
||
11 years ago
|
@Grab("hsqldb")
|
||
12 years ago
|
@Configuration
|
||
|
@EnableBatchProcessing
|
||
|
class JobConfig {
|
||
|
|
||
|
@Autowired
|
||
|
private JobBuilderFactory jobs
|
||
|
|
||
|
@Autowired
|
||
|
private StepBuilderFactory steps
|
||
|
|
||
|
@Bean
|
||
|
protected Tasklet tasklet() {
|
||
11 years ago
|
return new Tasklet() {
|
||
|
@Override
|
||
|
RepeatStatus execute(StepContribution contribution, ChunkContext context) {
|
||
|
return RepeatStatus.FINISHED
|
||
|
}
|
||
|
}
|
||
12 years ago
|
}
|
||
|
|
||
|
@Bean
|
||
|
Job job() throws Exception {
|
||
|
return jobs.get("job").start(step1()).build()
|
||
|
}
|
||
|
|
||
|
@Bean
|
||
|
protected Step step1() throws Exception {
|
||
|
return steps.get("step1").tasklet(tasklet()).build()
|
||
|
}
|
||
|
}
|