public interface MessageHandler
Dispatchers
use the MessageHandler interface to define the listener
for their messages. Each Dispatcher can have a single message handler, although the
handler can use the incoming message's subject to branch for the actual work.Modifier and Type | Method and Description |
---|---|
void |
onMessage(Message msg)
Called to deliver a message to the handler.
|
void onMessage(Message msg) throws java.lang.InterruptedException
The thread used to call onMessage will be interrupted if the connection is closed, or the dispatcher is stopped.
msg
- the received Messagejava.lang.InterruptedException
- if the dispatcher interrupts this handler