org.springframework.integration.dispatcher
Class BroadcastingDispatcher

java.lang.Object
  extended by org.springframework.integration.dispatcher.AbstractDispatcher
      extended by org.springframework.integration.dispatcher.BroadcastingDispatcher
All Implemented Interfaces:
MessageDispatcher, MessageSource, MessageTarget, SubscribableSource

public class BroadcastingDispatcher
extends AbstractDispatcher

A broadcasting dispatcher implementation. It makes a best effort to send the message to each of its targets. If it fails to send to any one target, it will log a warn-level message but continue to send to the other targets.

Author:
Mark Fisher

Field Summary
private  boolean applySequence
           
 
Fields inherited from class org.springframework.integration.dispatcher.AbstractDispatcher
logger, targets
 
Constructor Summary
BroadcastingDispatcher()
           
 
Method Summary
 boolean send(Message<?> message)
          Send a Message to this target.
 void setApplySequence(boolean applySequence)
          Specify whether to apply sequence numbers to the messages prior to sending to the targets.
 
Methods inherited from class org.springframework.integration.dispatcher.AbstractDispatcher
getTaskExecutor, sendMessageToTarget, setSendTimeout, setTaskExecutor, subscribe, unsubscribe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applySequence

private volatile boolean applySequence
Constructor Detail

BroadcastingDispatcher

public BroadcastingDispatcher()
Method Detail

setApplySequence

public void setApplySequence(boolean applySequence)
Specify whether to apply sequence numbers to the messages prior to sending to the targets. By default, sequence numbers will not be applied


send

public boolean send(Message<?> message)
Description copied from interface: MessageTarget
Send a Message to this target. May throw a RuntimeException for non-recoverable errors. Otherwise, if the Message cannot be sent for a non-fatal reason such as timeout, then this method will return 'false', and if the Message is sent successfully, it will return 'true'.

Parameters:
message - the Message to send
Returns:
whether the Message has been sent successfully