Don't use @PostConstruct

This commit is contained in:
dsyer
2009-12-04 19:14:58 +00:00
parent 8160cb1f1c
commit f37bdaa9d8

View File

@@ -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