org.springframework.integration.dispatcher
Interface MessageDispatcher

All Superinterfaces:
MessageSource, MessageTarget, SubscribableSource
All Known Implementing Classes:
AbstractDispatcher, BroadcastingDispatcher, SimpleDispatcher

public interface MessageDispatcher
extends MessageTarget, SubscribableSource

Strategy interface for dispatching messages.

Author:
Mark Fisher

Method Summary
 boolean send(Message<?> message)
          Send a Message to this target.
 void setSendTimeout(long sendTimeout)
          Specify the timeout for sending to a target (in milliseconds).
 boolean subscribe(MessageTarget target)
          Register a MessageTarget as a subscriber to this source.
 boolean unsubscribe(MessageTarget target)
          Remove a MessageTarget from the subscribers of this source.
 

Method Detail

send

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'.

Specified by:
send in interface MessageTarget
Parameters:
message - the Message to send
Returns:
whether the Message has been sent successfully

setSendTimeout

void setSendTimeout(long sendTimeout)
Specify the timeout for sending to a target (in milliseconds). Note that this value will only be applicable for blocking targets.


subscribe

boolean subscribe(MessageTarget target)
Description copied from interface: SubscribableSource
Register a MessageTarget as a subscriber to this source.

Specified by:
subscribe in interface SubscribableSource

unsubscribe

boolean unsubscribe(MessageTarget target)
Description copied from interface: SubscribableSource
Remove a MessageTarget from the subscribers of this source.

Specified by:
unsubscribe in interface SubscribableSource