Package net.engio.mbassy.dispatch
Class MessageDispatcher
java.lang.Object
net.engio.mbassy.subscription.AbstractSubscriptionContextAware
net.engio.mbassy.dispatch.MessageDispatcher
- All Implemented Interfaces:
IMessageDispatcher
,ISubscriptionContextAware
public class MessageDispatcher
extends AbstractSubscriptionContextAware
implements IMessageDispatcher
Standard implementation for direct, unfiltered message delivery.
For each message delivery, this dispatcher iterates over the listeners
and uses the previously provided handler invocation to deliver the message
to each listener
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMessageDispatcher
(SubscriptionContext context, IHandlerInvocation invocation) -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispatch
(MessagePublication publication, Object message, Iterable listeners) Delivers the given message to the given set of listeners.Get the handler invocation that will be used to deliver the message to each listener.Methods inherited from class net.engio.mbassy.subscription.AbstractSubscriptionContextAware
getContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.engio.mbassy.subscription.ISubscriptionContextAware
getContext
-
Field Details
-
invocation
-
-
Constructor Details
-
MessageDispatcher
-
-
Method Details
-
dispatch
Description copied from interface:IMessageDispatcher
Delivers the given message to the given set of listeners. Delivery may be delayed, aborted or restricted in various ways, depending on the configuration of the dispatcher- Specified by:
dispatch
in interfaceIMessageDispatcher
- Parameters:
publication
- The message publication that initiated the dispatchmessage
- The message that should be delivered to the listenerslisteners
- The listeners that should receive the message
-
getInvocation
Description copied from interface:IMessageDispatcher
Get the handler invocation that will be used to deliver the message to each listener.- Specified by:
getInvocation
in interfaceIMessageDispatcher
- Returns:
- the handler invocation that will be used to deliver the message to each listener
-