Package org.opentcs.util.event
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()
Creates a new instance. -
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.
-
Constructor Details
-
SimpleEventBus
public SimpleEventBus()Creates a new instance.
-
-
Method Details
-
onEvent
public void onEvent(java.lang.Object event)Description copied from interface:EventHandler
Processes the event object.- Specified by:
onEvent
in interfaceEventHandler
- Parameters:
event
- The event object.
-
subscribe
Description copied from interface:EventSource
Subscribes the given listener to events emitted by this source.- Specified by:
subscribe
in interfaceEventSource
- Parameters:
listener
- The listener to be subscribed.
-
unsubscribe
Description copied from interface:EventSource
Unsubscribes the given listener.- Specified by:
unsubscribe
in interfaceEventSource
- Parameters:
listener
- The listener to be unsubscribed.
-