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 Type
    Method
    Description
    Returns the name this event bus is identified by.
    void
    post(Object event)
    Distributes an event to all registered observers.
    void
    register(Object object)
    Registers an object to the event bus.
    void
    Unregisters an object from the event bus.
    void
    Unregisters 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

      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)