RESOLVED - issue BATCH-142: DefaultStepExecutorFactory as the stepExecutorFactory for the DefaultJobExecutor

http://opensource.atlassian.com/projects/spring/browse/BATCH-142
This commit is contained in:
dsyer
2007-10-05 15:32:52 +00:00
parent e613551cd5
commit 0b52801e35
2 changed files with 25 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ import org.springframework.batch.execution.step.simple.SimpleStepExecutor;
import org.springframework.batch.repeat.RepeatOperations;
import org.springframework.batch.repeat.policy.SimpleCompletionPolicy;
import org.springframework.batch.repeat.support.RepeatTemplate;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
/**
@@ -32,7 +33,7 @@ import org.springframework.util.Assert;
* @author Dave Syer
*
*/
public class SimpleStepExecutorFactory implements StepExecutorFactory {
public class SimpleStepExecutorFactory implements StepExecutorFactory, InitializingBean {
private JobRepository jobRepository;
@@ -70,8 +71,21 @@ public class SimpleStepExecutorFactory implements StepExecutorFactory {
}
/**
* Public setter for {@link JobRepository}.
*
* @param jobRepository is a mandatory dependence (no default).
*/
public void setJobRepository(JobRepository jobRepository) {
this.jobRepository = jobRepository;
}
/**
* Assert that all mandatory properties are set (the {@link JobRepository}).
*
* @throws Exception
*/
public void afterPropertiesSet() throws Exception {
Assert.notNull(jobRepository);
}
}