listeners - accepted events

In various listeners I see in the code base, the listener is tied to a contribution that defines the events to be routed to the listener. Yet the listener code seems to confirm the event to be handled - e.g. if (!EVENTS_TO_HANDLE.contains(event.getName())) { return; } In my debugging I've not yet observed an instance where a listener receives an event that it did not request in its corresponding contribution - so I'm just curious as to this construct. Thanks.

0 votes

1 answers

1270 views

ANSWER



This is historical, in the past there was no declaration of the accepted events in the listener extension point so events were dispatched to all listeners. This is not the case anymore, now listeners receive only events for which they have registered. Note also future work in this area: https://jira.nuxeo.com/browse/NXP-21576

0 votes



Thank you.
10/05/2017