Interface EventBus

  • All Implemented Interfaces:

    
    public interface EventBus
    
                        

    An interface with extended functionality that substitutes com.google.common.eventbus.EventBus.

    Google Guice's com.google.common.eventbus.EventBus implementation lacks support for unregistering all subscribers at once, which is added by providing the method unregisterAll.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract String identifier() Returns the name this event bus is identified by.
      abstract void register(Object object) Registers an object to the event bus.
      abstract void unregister(Object object) Unregisters an object from the event bus.
      abstract void unregisterAll() Unregisters all observers currently registered at the event bus.
      abstract void post(Object event) Distributes an event to all registered observers.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • identifier

         abstract String identifier()

        Returns the name this event bus is identified by.

        Returns:

        the identifier of this event bus.

      • register

         abstract void register(Object object)

        Registers an object to the event bus.

        Parameters:
        object - the object to register.
      • unregister

         abstract void unregister(Object object)

        Unregisters an object from the event bus.

        Parameters:
        object - the object to unregister.
      • unregisterAll

         abstract void unregisterAll()

        Unregisters all observers currently registered at the event bus.

      • post

         abstract void post(Object event)

        Distributes an event to all registered observers.

        Parameters:
        event - the event to distribute.