CLOSED - issue BATCH-563: ItemOrientedStep can be TaskletStep + ItemOrientedTasklet

This commit is contained in:
dsyer
2008-07-17 11:33:55 +00:00
parent 6810996c23
commit acbc1d89ed
3 changed files with 28 additions and 30 deletions

View File

@@ -140,11 +140,37 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
this.name = name;
}
/**
* Extension point for subclasses to execute business logic.
*
* @param stepExecution
* @return {@link ExitStatus} to show whether the step is finished
* processing.
* @throws Exception
*/
protected abstract ExitStatus doExecute(StepExecution stepExecution) throws Exception;
protected abstract void open(ExecutionContext ctx) throws Exception;
/**
* Extension point for subclasses to provide callbacks to their
* collaborators at the beginning of a step, to open or acquire resources.
* Does nothing by default.
*
* @param ctx the {@link ExecutionContext} to use
* @throws Exception
*/
protected void open(ExecutionContext ctx) throws Exception {
}
protected abstract void close(ExecutionContext ctx) throws Exception;
/**
* Extension point for subclasses to provide callbacks to their
* collaborators at the end of a step (right at the end of the finally
* block), to close or release resources. Does nothing by default.
*
* @param ctx the {@link ExecutionContext} to use
* @throws Exception
*/
protected void close(ExecutionContext ctx) throws Exception {
}
/**
* Template method for step execution logic - calls abstract methods for

View File

@@ -98,14 +98,4 @@ public class TaskletStep extends AbstractStep {
return tasklet.execute();
}
protected void close(ExecutionContext ctx) throws Exception {
}
protected void open(ExecutionContext ctx) throws Exception {
}
}

View File

@@ -120,24 +120,6 @@ public class MessageOrientedStep extends AbstractStep {
}
/**
* Do nothing.
*
* @see org.springframework.batch.core.step.AbstractStep#open(org.springframework.batch.item.ExecutionContext)
*/
@Override
protected void open(ExecutionContext ctx) throws Exception {
}
/**
* Do nothing.
*
* @see org.springframework.batch.core.step.AbstractStep#close(org.springframework.batch.item.ExecutionContext)
*/
@Override
protected void close(ExecutionContext ctx) throws Exception {
}
/**
* @param expectedJobId
*/