public interface EventDispatcher
This interface is intended to be implemented by instances that use, for example, Guava's EventBus or GreenRobot's EventBus on Android. Such implementations use runtime types to match events to subscribers. As such, the methods in this class are type-free.
Modifier and Type | Interface and Description |
---|---|
static class |
EventDispatcher.EmptyEventDispatcher
An empty implementation of the EventDispatcher.
|
Modifier and Type | Method and Description |
---|---|
void |
dispatchEvent(java.lang.Object event)
Dispatch an arbitrary event object to the registered subscribers.
|
void |
register(java.lang.Object subscriber)
Register a subscriber with this EventDispatcher.
|
void |
unregister(java.lang.Object subscriber)
Unregister a subscriber from this EventDispatcher.
|
void dispatchEvent(java.lang.Object event)
event
- The event to dispatch.void register(java.lang.Object subscriber)
subscriber
- The subscriber to register.void unregister(java.lang.Object subscriber)
subscriber
- The subscriber to unregister.