8.3.1 Event Listeners

An application registers its interest in events by registering an event listener with the workspace. Listeners are per workspace, not repository-wide; they only receive events for the workspace in which they are registered.

Note that it is up to the implementation whether changes made to the subtree below jcr:system trigger events (6.8 System Node).

When an persistent change occurs, the repository calls the onEvent method of each registered listener that is entitled (based on the filters set for that listener) to receive notification, and passes it an EventIterator object. The EventIterator contains the bundle of events (again, filtered for that particular listener) that describe the persistent changes made to the workspace.

javax.jcr.observation.
EventListener

void

onEvent(EventIterator event)

This method is called when a bundle of events is dispatched. See 8.3.4 Event Production.