Files
gerrit/gerrit-sshd
Hugo Arès bc1093d901 Define an extension for user scoped event listeners
There are 2 types of event listeners: unrestricted, which see all
events, and restricted, which only see the events of a particular user.

The unrestricted listeners are registered using an EventListener
extension point and are held in a DynamicSet. The restricted listeners
were not defined by an extension point, needed to be registered using
the EventSource interface and were held in the instance implementing
that interface. In fact, the EventSource interface only existed to
allow to register restricted listeners. The EventDispatcher is
notifying both type of listeners when an event is posted.

The main motivation for defining EventSource and EventDispatcher
interfaces was to eventually allow a plugin to replace their core
implementations. The problem is, if the listeners are held in the
instance of EventSource provided by the core, they will no longer be
notified when an EventSource instance is loaded from a plugin since all
the listeners will be registered to the wrong instance.

Fix the inconsistency between both type of listeners by removing the
EventSource interface. Create a sub-interface of EventListener called
UserScopedEventListener and expose it also as an extension point.

Now that both type of listeners are held in a DynamicSet maintained by
the core, a plugin will be able to replace the core EventDispatcher.

Change-Id: Ieecb1d6f0ec64d43a0350ec1c133b6ecc189db67
2016-03-08 13:28:33 -05:00
..