There are many times when using the MultiResourceItemReader where important information is part of the Resource itself. An example from one my current jobs is a directory with file names like:
The xml files in this case are all formatted exactly the same, so it's a perfect case for the MultiResourceItemReader. However, the filename itself contains important information. Each file has a different designator: FO, FM, FE, which indicates the 'database' it belongs to. Unfortunately, this information is not included in the records themselves. Therefore, the only solution is to know what Resource (in this case a file) a particular item came from.
Thus, I would like to create an interface called ResourceAware. If an Item implements this interface, the MRIR will inject the current resource into the item.