Package net.engio.mbassy.dispatch
Interface IMessageDispatcher
-
- All Superinterfaces:
ISubscriptionContextAware
- All Known Implementing Classes:
DelegatingMessageDispatcher
,EnvelopedMessageDispatcher
,FilteredMessageDispatcher
,MessageDispatcher
public interface IMessageDispatcher extends ISubscriptionContextAware
A message dispatcher provides the functionality to deliver a single message to a set of listeners. A message dispatcher uses a message context to access all information necessary for the message delivery. The delivery of a single message to a single listener is responsibility of the handler invocation object associated with the dispatcher. Implementations if IMessageDispatcher are partially designed using decorator pattern such that it is possible to compose different message dispatchers into dispatcher chains to achieve more complex dispatch logic.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
dispatch(MessagePublication publication, java.lang.Object message, java.lang.Iterable listeners)
Delivers the given message to the given set of listeners.IHandlerInvocation
getInvocation()
Get the handler invocation that will be used to deliver the message to each listener.-
Methods inherited from interface net.engio.mbassy.subscription.ISubscriptionContextAware
getContext
-
-
-
-
Method Detail
-
dispatch
void dispatch(MessagePublication publication, java.lang.Object message, java.lang.Iterable listeners)
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- 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
IHandlerInvocation getInvocation()
Get the handler invocation that will be used to deliver the message to each listener.- Returns:
- the handler invocation that will be used to deliver the message to each listener
-
-