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 TypeMethodDescriptionvoiddispatch(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
getContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.engio.mbassy.subscription.ISubscriptionContextAware
getContext
-
Field Details
-
invocation
-
-
Constructor Details
-
MessageDispatcher
-
-
Method Details
-
dispatch
Description copied from interface:IMessageDispatcherDelivers 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:
dispatchin 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:IMessageDispatcherGet the handler invocation that will be used to deliver the message to each listener.- Specified by:
getInvocationin interfaceIMessageDispatcher- Returns:
- the handler invocation that will be used to deliver the message to each listener
-