Don't use @PostConstruct
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
package org.springframework.batch.core.scope;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
public class JobStartupRunner {
|
||||
public class JobStartupRunner implements InitializingBean {
|
||||
|
||||
private Step step;
|
||||
|
||||
@@ -14,8 +13,7 @@ public class JobStartupRunner {
|
||||
this.step = step;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void launch() throws Exception {
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
StepExecution stepExecution = new StepExecution("step", new JobExecution(1L), 0L);
|
||||
step.execute(stepExecution);
|
||||
// expect no errors
|
||||
|
||||
Reference in New Issue
Block a user