BATCH-553:Added a protected getter for ChunkOperations to SimpleStepFactoryBean

This commit is contained in:
lucasward
2008-04-09 03:53:48 +00:00
parent 3edc30eec6
commit 58448aa23b

View File

@@ -54,6 +54,8 @@ public class SimpleStepFactoryBean extends AbstractStepFactoryBean {
private ItemHandler itemHandler; private ItemHandler itemHandler;
private RepeatTemplate stepOperations; private RepeatTemplate stepOperations;
private RepeatTemplate chunkOperations;
private ExceptionHandler exceptionHandler; private ExceptionHandler exceptionHandler;
@@ -66,7 +68,7 @@ public class SimpleStepFactoryBean extends AbstractStepFactoryBean {
public void setCommitInterval(int commitInterval) { public void setCommitInterval(int commitInterval) {
this.commitInterval = commitInterval; this.commitInterval = commitInterval;
} }
/** /**
* The streams to inject into the {@link Step}. Any instance of * The streams to inject into the {@link Step}. Any instance of
* {@link ItemStream} can be used, and will then receive callbacks at the * {@link ItemStream} can be used, and will then receive callbacks at the
@@ -105,6 +107,16 @@ public class SimpleStepFactoryBean extends AbstractStepFactoryBean {
protected RepeatTemplate getStepOperations() { protected RepeatTemplate getStepOperations() {
return stepOperations; return stepOperations;
} }
/**
* Protected getter for the chunk operations to make them available in
* subclasses.
* @return the step operations
*/
protected RepeatTemplate getChunkOperations() {
return chunkOperations;
}
/** /**
* Public setter for the SimpleLimitExceptionHandler. * Public setter for the SimpleLimitExceptionHandler.
@@ -181,7 +193,7 @@ public class SimpleStepFactoryBean extends AbstractStepFactoryBean {
BatchListenerFactoryHelper helper = new BatchListenerFactoryHelper(); BatchListenerFactoryHelper helper = new BatchListenerFactoryHelper();
RepeatTemplate chunkOperations = new RepeatTemplate(); chunkOperations = new RepeatTemplate();
chunkOperations.setCompletionPolicy(new SimpleCompletionPolicy(commitInterval)); chunkOperations.setCompletionPolicy(new SimpleCompletionPolicy(commitInterval));
helper.addChunkListeners(chunkOperations, listeners); helper.addChunkListeners(chunkOperations, listeners);
step.setChunkOperations(chunkOperations); step.setChunkOperations(chunkOperations);