Package sonia.scm.event
Class ScmEventBus
java.lang.Object
sonia.scm.event.ScmEventBus
Dispatches events to listeners, and provides ways for listeners to register
themselves. The ScmEventBus searches its implementation with the
ServiceLoader
.- Since:
- 1.23
- See Also:
-
EventBus
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ScmEventBus
Returns the singleton instance of the ScmEventBusabstract void
Post an event through the event bus.abstract void
Register all handler methods with theSubscribe
annotation as subscriber for the event bus.abstract void
unregister
(Object subscriber) Unregister the given subscriber object from the event bus.
-
Constructor Details
-
ScmEventBus
public ScmEventBus()
-
-
Method Details
-
getInstance
Returns the singleton instance of the ScmEventBus -
post
Post an event through the event bus. All registered subscribers will be notified by the event bus.- Parameters:
event
- event to send through the event bus
-
register
Register all handler methods with theSubscribe
annotation as subscriber for the event bus. -
unregister
Unregister the given subscriber object from the event bus.
-