Package org.somda.sdc.common.event
Interface EventBus
- All Known Implementing Classes:
EventBusImpl
public interface EventBus
An interface with extended functionality that substitutes EventBus.
Google Guice's EventBus implementation lacks support for unregistering all
subscribers at once, which is added by providing the method unregisterAll().
-
Method Summary
Modifier and TypeMethodDescriptionReturns the name this event bus is identified by.voidDistributes an event to all registered observers.voidRegisters an object to the event bus.voidunregister(Object object) Unregisters an object from the event bus.voidUnregisters all observers currently registered at the event bus.
-
Method Details
-
identifier
String identifier()Returns the name this event bus is identified by.- Returns:
- the identifier of this event bus.
- See Also:
-
EventBus.identifier()
-
register
Registers an object to the event bus.- Parameters:
object- the object to register.- See Also:
-
EventBus.register(Object)
-
unregister
Unregisters an object from the event bus.- Parameters:
object- the object to unregister.- See Also:
-
EventBus.unregister(Object)
-
unregisterAll
void unregisterAll()Unregisters all observers currently registered at the event bus. -
post
Distributes an event to all registered observers.- Parameters:
event- the event to distribute.- See Also:
-
EventBus.post(Object)
-