| java.lang.Object | |
| ↳ | com.atlassian.event.internal.LockFreeEventPublisher |
A non-blocking implementation of the EventPublisher interface.
This class is a drop-in replacement for EventPublisherImpl except that it does not
synchronise on the internal map of event type to ListenerInvoker, and should handle
much higher parallelism of event dispatch.
One can customise the event listening by instantiating with custom
listener handlers and the event dispatching through
EventDispatcher. See the com.atlassian.event.spi package
for more information.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
If you need to customise the asynchronous handling, you should use the
AsynchronousAbleEventDispatcher
together with a custom executor. | |||||||||||
| 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.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.event.api.EventPublisher
| |||||||||||
If you need to customise the asynchronous handling, you should use the
AsynchronousAbleEventDispatcher
together with a custom executor.
You might also want to have a look at using the
EventThreadFactory to keep the naming
of event threads consistent with the default naming of the Atlassian Event
library.
| eventDispatcher | the event dispatcher to be used with the publisher |
|---|---|
| listenerHandlersConfiguration | the list of listener handlers to be used with this publisher |
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 |
|---|
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 |
|---|
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 |
|---|
Un-register all listeners that this publisher knows about.