Interface MessageDispatcher
- All Known Implementing Classes:
- AbstractDispatcher,- BroadcastingDispatcher,- PartitionedDispatcher,- UnicastingDispatcher
public interface MessageDispatcher
Strategy interface for dispatching messages to handlers.
- Author:
- Mark Fisher, Gary Russell
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaddHandler(MessageHandler handler) Add a message handler.booleanDispatch the message.intReturn the current handler count.booleanremoveHandler(MessageHandler handler) Remove a message handler.
- 
Method Details- 
addHandlerAdd a message handler.- Parameters:
- handler- the handler.
- Returns:
- true if successfully added.
 
- 
removeHandlerRemove a message handler.- Parameters:
- handler- the handler.
- Returns:
- true of successfully removed.
 
- 
dispatchDispatch the message.- Parameters:
- message- the message.
- Returns:
- true if dispatched.
 
- 
getHandlerCountint getHandlerCount()Return the current handler count.- Returns:
- the handler count.
 
 
-