benas/easy-batch — pull request #45 by xenji (2014-12-29 08:03:08+00:00)
Title: Feature: add event listeners for the whole process

Hey all,

I've added this unrequested feature due my need to open and close resources (namely JCR sessions) on specific events within the batch process. While I just needed it after each processing and before each map, I decided to make it a full-blown event approach.

The EventManager Interface has all methods to support the full lifecycle of events during the process. The delivered implementation is just a local one, but it could be replaced with e.g. a distributed one (JMS, HornetQ, Akka, you name it...).

The event listeners divide into two sections: Global ones for the batch events (start, end, exception) and step bound ones for each step (mostly before and after the step execution). There currently only one exception event handler for the reader, as this is in my opinion the most relevant one. This could be extended later on without any hassle.

All present tests pass for this PR, currently the tests for this feature are missing.

Looking forward for your feedback!
Regards,
Mario