Interface MessageBusListener
- All Known Subinterfaces:
SyncMessageBusListener
Asynchronous MessageBus listener interface
With this interface, the MessageBus (channel) listening can be implemented. If the MessageBus (channel) receives a message, then every class or component, that is set to listen to that MessageBus (channel), will receive the message. This is done by having the onMessageReceived method called, that will contain the message.
If this interface is used for listening to MessageBuses (channels), then when a message arrives, the listener will immediately be called asynchronously.
If you want to call the listener synchronously, then use the SyncMessageBusListener
interface for implementing the listener.
- Since:
- 4.0
- Author:
- JBStrap
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onMessageReceived
(String busName, Object message) Method for processing messages recieved through MessageBus
-
Method Details
-
onMessageReceived
Method for processing messages recieved through MessageBus
The method will be called, if the listened MessageBus has received a message
- Parameters:
busName
- The name of the MessageBus that had the message arrive to.message
- The class containing the message. Can be any serializable class.
-