Class SimpleEventBus

java.lang.Object
org.opentcs.util.event.SimpleEventBus
All Implemented Interfaces:
EventBus, EventHandler, EventSource

public class SimpleEventBus
extends java.lang.Object
implements EventBus
A plain implementation of EventBus.
  • Constructor Summary

    Constructors 
    Constructor Description
    SimpleEventBus()  
  • Method Summary

    Modifier and Type Method Description
    void onEvent​(java.lang.Object event)
    Processes the event object.
    void subscribe​(EventHandler listener)
    Subscribes the given listener to events emitted by this source.
    void unsubscribe​(EventHandler listener)
    Unsubscribes the given listener.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • onEvent

      public void onEvent​(java.lang.Object event)
      Description copied from interface: EventHandler
      Processes the event object.
      Specified by:
      onEvent in interface EventHandler
      Parameters:
      event - The event object.
    • subscribe

      public void subscribe​(EventHandler listener)
      Description copied from interface: EventSource
      Subscribes the given listener to events emitted by this source.
      Specified by:
      subscribe in interface EventSource
      Parameters:
      listener - The listener to be subscribed.
    • unsubscribe

      public void unsubscribe​(EventHandler listener)
      Description copied from interface: EventSource
      Unsubscribes the given listener.
      Specified by:
      unsubscribe in interface EventSource
      Parameters:
      listener - The listener to be unsubscribed.