JCR Listener: receiving events in "bundle"
Ok JCR experts, there's something I need to know:
I registered a JCR listener to catch NODE_MOVED and NODE_REMOVED events. This is working well. The method we need to override when implementing the EventListener interface, onEvent, receives an EventIterator. So sometimes, events are bundled together. What's the rule here? Is there even one? The spec doesn't tell.
For instance, when moving a tag in CQ5 tagging UI, my listener receives 1 bundle of 2 events (sometimes 3):
a NODE_REMOVED event: source node is deleted
a NODE_MOVED event: to reflect the move operation with the source/dest path
sometimes, there's a 3rd event in there, another NODE_REMOVED event, but with another node ID and I have no idea what it represents
So here I can see why they are bundled together: there's a relationship between them, they're kind of part of the same "atomic" operation. But can I rely on this?
Thank you so much.