public interface Receiver
MessageDispatcher
.
Once a receiver is registered through registerReceiver
method, every message that arrives at the dispatcher is passed to the registered receivers through
acceptMessage
in sequence until a receiver accepts the message.MessageDispatcher
Modifier and Type | Method and Description |
---|---|
boolean |
acceptMessage(Message msg,
boolean allowSuperclass)
Offers a message to this receiver for acceptance.
|
boolean acceptMessage(Message msg, boolean allowSuperclass)
MessageDispatcher
when new message arrives.
True is returned, if this receiver accepts the offered message
(and the processing of the message is stopped at message dispatcher's level).msg
- the message offered for acceptanceallowSuperclass
- First, the message is offered with allowSuperclass set to false.
If no receiver accepts it, another offering round is issued with allowSuperclass
set to true (so the receiver can relax its acceptance conditions).