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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user