com.atlassian.event.api.EventPublisher |
Known Indirect Subclasses |
Interface to publish events. It allows the decoupling of listeners which handle events and publishers which dispatch events.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Publish an event that will be consumed by all listeners which have registered to receive it.
| |||||||||||
Register a listener to receive events.
| |||||||||||
Un-register a listener so that it will no longer receive events.
| |||||||||||
Un-register all listeners that this publisher knows about.
|
Publish an event that will be consumed by all listeners which have registered to receive it.
Implementations must dispatch events to listeners which have a public method annotated with
EventListener
and one argument which is assignable from the event type (i.e. a superclass
or interface implemented by the event object). Implementations may also dispatch events
to legacy EventListener
implementations based on the types returned
from getHandledEventClasses()
.
This method should process all event listeners, despite any errors or exceptions that are generated
as a result of dispatching the event.
event | the event to publish |
---|
NullPointerException | if the event is null
|
---|
Register a listener to receive events. All implementations must support registration of listeners
where event handling methods are indicated by the EventListener
annotation. Legacy
implementations may also support listeners which implement the now-deprecated
EventListener
interface.
listener | The listener that is being registered |
---|
NullPointerException | if the listener is null |
---|---|
IllegalArgumentException | if the parameter is not found to be an actual listener |
Un-register a listener so that it will no longer receive events. If the given listener is not registered nothing will happen.
listener | The listener to un-register |
---|
NullPointerException | if the listener is null
|
---|
Un-register all listeners that this publisher knows about.