org.springframework.integration.dispatcher
Class SimpleDispatcher
java.lang.Object
org.springframework.integration.dispatcher.AbstractDispatcher
org.springframework.integration.dispatcher.SimpleDispatcher
- All Implemented Interfaces:
- MessageDispatcher, MessageSource, MessageTarget, SubscribableSource
public class SimpleDispatcher
- extends AbstractDispatcher
Basic implementation of MessageDispatcher
that will attempt
to send a Message
to one of its targets. As soon as one
of the targets accepts the Message, the dispatcher will return 'true'.
If all targets reject the Message, the dispatcher will throw a
MessageRejectedException. If all targets return 'false' (e.g. due
to a timeout), the dispatcher will return 'false'.
- Author:
- Mark Fisher
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleDispatcher
public SimpleDispatcher()
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