I'm using FlatFileItemWriter with FlatFileHeaderCallback. My FlatFileHeaderCallback needs to retrieve some values from the ExecutionContext. How will my FlatFileHeaderCallback implementation gain access to the ExecutionContext?
I tried implementing the StepExecutionListener and the ItemStream, but none of their methods were called.
Alternative approaches I see seem to look more like a workaround:
1. Create an ItemWriter that either extends or wraps a FlatFileItemWriter, and override or implement either StepExecutionListener or ItemStream to get the ExecutionContext and pass it to the FlatFileHeaderCallback implementation's constructor.
2. Add a StepExecutionListener in the step and pass the FlatFileHeaderCallback implementation. StepExecutionListener will then set the ExecutionContext.