Package org.somda.sdc.common.event
Interface EventBus
-
- All Known Implementing Classes:
EventBusImpl
public interface EventBusAn interface with extended functionality that substitutes EventBus.Google Guice's
EventBusimplementation lacks support for unregistering all subscribers at once, which is added by providing the methodunregisterAll().
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringidentifier()Returns the name this event bus is identified by.voidpost(Object event)Distributes an event to all registered observers.voidregister(Object object)Registers an object to the event bus.voidunregister(Object object)Unregisters an object from the event bus.voidunregisterAll()Unregisters all observers currently registered at the event bus.
-
-
-
Method Detail
-
identifier
String identifier()
Returns the name this event bus is identified by.- Returns:
- the identifier of this event bus.
- See Also:
EventBus.identifier()
-
register
void register(Object object)
Registers an object to the event bus.- Parameters:
object- the object to register.- See Also:
EventBus.register(Object)
-
unregister
void unregister(Object object)
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
void post(Object event)
Distributes an event to all registered observers.- Parameters:
event- the event to distribute.- See Also:
EventBus.post(Object)
-
-