public class EventBus
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
EventBus.Subscribe |
| Constructor and Description |
|---|
EventBus() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(java.lang.Object listener,
java.util.concurrent.Executor executor)
Adds a listener to the bus provided it is not already a listener in which case
this action does nothing.
|
java.lang.Object |
findListener(java.lang.Class aclass)
Find a listener on the bus of a given class.
|
long |
getLastDispatchMillis()
Get the timestamp of the last event dispatched.
|
void |
post(java.lang.Object event)
Post an event or object onto the bus.
|
void |
removeListener(java.lang.Object listener)
Remove a listener from the bus provided it is already a listener.
|
void |
resume()
Resume delivery of events.
|
void |
suspend()
Temporarily suspend event delivery.
|
public void suspend()
public void resume()
public long getLastDispatchMillis()
public void addListener(java.lang.Object listener,
java.util.concurrent.Executor executor)
listener - The object that is listening for Events (or any class)executor - The executor that is used to call those event handlers.public void removeListener(java.lang.Object listener)
listener - Listener to be removed.public java.lang.Object findListener(java.lang.Class aclass)
aclass - Class of the listener to findpublic void post(java.lang.Object event)
event - The object to be dispatched.