public interface Dispatcher
A dispatcher is basically the internal logic of the event bus as its implementation governs the delivery of the events to the registered event handlers.
Different implementations may choose different dispatching strategies (for example, by scheduling to other threads, queuing events, etc.).
| Modifier and Type | Method and Description |
|---|---|
void |
dispatch(Event<Object> event,
Map<EventHandler<Object>,EventFilter<Object>> eventHandlers,
Collection<EventHandler<Object>> undeliveredEventHandlers,
Collection<ExceptionHandler> exceptionHandlers)
Dispatches the specified event to the specified event filters and handlers.
|
void |
dispose()
Disposes all resources (for example, threads) used by this dispatcher.
|
void dispatch(Event<Object> event, Map<EventHandler<Object>,EventFilter<Object>> eventHandlers, Collection<EventHandler<Object>> undeliveredEventHandlers, Collection<ExceptionHandler> exceptionHandlers)
event - Event to be dispatched.eventHandlers - Event handlers that are candidates for receiving the event.undeliveredEventHandlers - Evant handlers that should process undelivered events.exceptionHandlers - Exception handlers to be used in case an exception is thrown during the
dispatching or processing of the event.void dispose()
After calling this method, the dispatcher may no longer be used.
Copyright © 2017. All rights reserved.