IN PROGRESS - issue BATCH-121: BatchResourceFactoryBean - is it adding any value?

http://opensource.atlassian.com/projects/spring/browse/BATCH-121

Expose the StepExecution to the StepContext early enough for a stepOperations interceptor to find it in the open() method.  See also BATCH-125.
This commit is contained in:
dsyer
2007-10-05 16:04:08 +00:00
parent 3b7b95626b
commit efc6247e90
2 changed files with 37 additions and 5 deletions

View File

@@ -161,6 +161,7 @@ public class SimpleStepExecutor implements StepExecutor {
ExitStatus status = ExitStatus.FAILED;
final SimpleStepContext stepScopeContext = StepSynchronizationManager.open();
stepScopeContext.setStepExecution(stepExecution);
try {
stepExecution.setStartTime(new Timestamp(System.currentTimeMillis()));
@@ -182,7 +183,6 @@ public class SimpleStepExecutor implements StepExecutor {
stepExecution.getJobExecution().unregisterStepContext(context);
}
});
stepScopeContext.setStepExecution(stepExecution);
context.setAttribute(StepScope.ID_KEY, stepExecution.getJobExecution()
.getJobIdentifier());
// Mark the context as a step context as a hint to scope