View Javadoc
1   package com.atlassian.event.api;
2   
3   public interface EventListenerRegistrar {
4       /**
5        * Register a listener to receive events. All implementations must support registration of listeners
6        * where event handling methods are indicated by the {@link com.atlassian.event.api.EventListener} annotation. Legacy
7        * implementations may also support listeners which implement the now-deprecated
8        * {@link com.atlassian.event.EventListener} interface.
9        *
10       * @param listener The listener that is being registered
11       * @throws NullPointerException     if the listener is {@code null}
12       * @throws IllegalArgumentException if the parameter is not found to be an actual listener
13       * @see com.atlassian.event.api.EventListener annotation which can be used to indicate event listener methods
14       */
15      void register(Object listener);
16  
17      /**
18       * Un-register a listener so that it will no longer receive events. If the given listener is not registered nothing
19       * will happen.
20       *
21       * @param listener The listener to un-register
22       * @throws NullPointerException if the listener is {@code null}
23       */
24      void unregister(Object listener);
25  
26      /**
27       * Un-register all listeners that this registrar knows about.
28       */
29      void unregisterAll();
30  }