OPEN - issue BATCH-324: Step as factory for StepExecutor

http://jira.springframework.org/browse/BATCH-324

run/process -> execute
This commit is contained in:
dsyer
2008-01-30 15:17:42 +00:00
parent 0734480dd6
commit 02f1ae5c0c
20 changed files with 56 additions and 49 deletions

View File

@@ -26,7 +26,7 @@ import org.springframework.batch.io.exception.BatchCriticalException;
* step.
*
* @author Dave Syer
*
*
*/
public interface Job {
@@ -38,6 +38,13 @@ public interface Job {
boolean isRestartable();
void run(JobExecution execution) throws BatchCriticalException;
/**
* Run the {@link JobExecution} and update the meta information like status
* and statistics as necessary.
*
* @param execution a {@link JobExecution}
* @throws BatchCriticalException
*/
void execute(JobExecution execution) throws BatchCriticalException;
}

View File

@@ -43,7 +43,7 @@ public class JobExecution extends Entity {
private ExitStatus exitStatus = ExitStatus.UNKNOWN;
// Package private constructor for Hibernate
// Package private constructor for testing
JobExecution() {
}

View File

@@ -133,7 +133,7 @@ public class JobSupport implements BeanNameAware, Job {
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.Job#run(org.springframework.batch.core.domain.JobExecution)
*/
public void run(JobExecution execution) throws BatchCriticalException {
public void execute(JobExecution execution) throws BatchCriticalException {
throw new UnsupportedOperationException("JobSupport does not provide an implementation of run(). Use a smarter subclass.");
}

View File

@@ -67,6 +67,6 @@ public interface Step {
* @throws BatchCriticalException if there is a problem that needs to be
* signalled to the caller
*/
void process(StepExecution stepExecution) throws StepInterruptedException, BatchCriticalException;
void execute(StepExecution stepExecution) throws StepInterruptedException, BatchCriticalException;
}

View File

@@ -134,9 +134,9 @@ public class StepSupport implements Step, BeanNameAware {
*
* @throws UnsupportedOperationException always
*
* @see org.springframework.batch.core.domain.Step#process(org.springframework.batch.core.domain.StepExecution)
* @see org.springframework.batch.core.domain.Step#execute(org.springframework.batch.core.domain.StepExecution)
*/
public void process(StepExecution stepExecution)
public void execute(StepExecution stepExecution)
throws StepInterruptedException, BatchCriticalException {
throw new UnsupportedOperationException(
"Cannot process a StepExecution. Use a smarter subclass of StepSupport.");