OPEN - issue BATCH-324: Step as factory for StepExecutor
http://jira.springframework.org/browse/BATCH-324 run/process -> execute
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user