public interface EventBus
MyEvent myEvent = createMyEvent(); eventBus.publish(myEvent);The event bus will determine the type of event and then dispatch the event to components that wish to receive events of that type.
Subscribe-annotated method(s) will be invoked as expected. This design (and its constituent helper components) was largely influenced by Guava's EventBus concept, although no code was viewed/copied/imported (even though Guava code is Apache 2.0 licensed and could have been used).
|Modifier and Type||Method and Description|
Publishes the specified event to an event subsystem that will deliver events to relevant
Registers all event handler methods on the specified instance to receive relevant events.
Unregisters all previously-registered event handler methods on the specified instance.
event- The event object to distribute to relevant subscribers.
EventBusimplementation, typically by using an
subscriber- the object whose event handler methods should be registered to receive events.
Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.