IN PROGRESS - issue BATCH-894: RFC: move ExitStatus up into Core?

Change Tasklet to use RepeatStatus instead of ExitStatus to signal continuable status
This commit is contained in:
dsyer
2008-11-08 11:33:25 +00:00
parent 11faa837af
commit 16606e3abd
34 changed files with 173 additions and 134 deletions

View File

@@ -1,8 +1,8 @@
package org.springframework.batch.test.sample;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.AttributeAccessor;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
@@ -11,16 +11,16 @@ public class SampleTasklet implements Tasklet {
@Autowired
private SimpleJdbcTemplate jdbcTemplate;
private int id = 0;
public SampleTasklet(int id) {
this.id = id;
}
public ExitStatus execute(StepContribution contribution, AttributeAccessor attributes) throws Exception {
public RepeatStatus execute(StepContribution contribution, AttributeAccessor attributes) throws Exception {
System.err.println("SampleTasklet1.execute()");
this.jdbcTemplate.update("insert into TESTS(ID, NAME) values (?, 'SampleTasklet" + id + "')", id);
return ExitStatus.FINISHED;
return RepeatStatus.FINISHED;
}
}