Class EventBus
- java.lang.Object
-
- software.amazon.disco.agent.reflect.event.EventBus
-
public class EventBus extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description EventBus()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddListener(Listener l)Add a listener to the EventBusstatic booleanisListenerPresent(Listener l)Test if a given listener is currently registered with the EventBusstatic voidpublish(Event e)Publish an event which will be broadcast to all listenersstatic voidremoveAllListeners()Remove all listeners from the EventBus, returning it to its initial statestatic voidremoveListener(Listener l)Remove a listener from the EventBus
-
-
-
Method Detail
-
publish
public static void publish(Event e)
Publish an event which will be broadcast to all listeners- Parameters:
e- the event to publish
-
addListener
public static void addListener(Listener l)
Add a listener to the EventBus- Parameters:
l- the listener to add
-
removeListener
public static void removeListener(Listener l)
Remove a listener from the EventBus- Parameters:
l- the listener to remove. It is safe to remove a listener not currently added.
-
removeAllListeners
public static void removeAllListeners()
Remove all listeners from the EventBus, returning it to its initial state
-
isListenerPresent
public static boolean isListenerPresent(Listener l)
Test if a given listener is currently registered with the EventBus- Parameters:
l- the listener to test for- Returns:
- true if the listener is presently registered to receive events
-
-