1 package com.atlassian.plugin.event;
2
3 /**
4 * Defines the event manager for use with internal Atlassian Plugins framework events. How listeners are defined is up
5 * to the implementation. Implementations should allow listeners to somehow identify which events they would like to
6 * listen for, then have the appropriate methods called if the event is the desired class or a subclass/implementation.
7 * This means a listener could listen for an event of type java.lang.Object and should be notified for every event.
8 */
9 public interface PluginEventManager {
10 /**
11 * Registers a listener object
12 *
13 * @param listener The listener instance. Cannot be null.
14 */
15 void register(Object listener);
16
17 /**
18 * Unregisters a listener object
19 *
20 * @param listener The listener. Cannot be null.
21 */
22 void unregister(Object listener);
23
24 /**
25 * Broadcasts an event to all applicable listeners.
26 *
27 * @param event The event object. Cannot be null.
28 * @throws NotificationException If an exception is thrown by one of the Event Listeners.
29 */
30 void broadcast(Object event) throws NotificationException;
31 }