*Aware interfaces
You will often want to access this object or one of its child to :
access provided user parameters in your components
leave some information on the job execution: logs, summary, warning…
To do that, your component will need to implement an interface, telling the library that you need something.
What is JobExecutionAwareInterface?
The JobExecutionAwareInterface will allow you to gain access to the current JobExecution.
Note
This interface is covered by JobExecutionAwareTrait for a default implementation that is most of the time sufficient.
What is JobParametersAwareInterface?
The JobParametersAwareInterface will allow you to gain access to the JobParameters of the current execution.
Note
This interface is covered by JobParametersAwareTrait for a default implementation that is most of the time sufficient.
What is SummaryAwareInterface?
The SummaryAwareInterface will allow you to gain access to the Summary of the current execution.
Note
This interface is covered by SummaryAwareTrait for a default implementation that is most of the time sufficient.
How does that work exactly?
There is no magic involved here, every component is responsible for propagating the context through these interfaces.
In the library, you will find that :
ItemJob is propagating context to ItemReaderInterface, ItemProcessorInterface and ItemWriterInterface.
Every ItemReaderInterface, ItemProcessorInterface and ItemWriterInterface acting as a decorator, is propagating context to their decorated element.
You can add this interface to any class, but you are responsible for the context propagation.
See also