org.springframework.integration.message
Interface BlockingTarget

All Superinterfaces:
MessageTarget
All Known Subinterfaces:
MessageChannel, PollableChannel
All Known Implementing Classes:
AbstractMessageChannel, AbstractPollableChannel, DefaultErrorChannel, DirectChannel, NullChannel, PriorityChannel, PublishSubscribeChannel, QueueChannel, RendezvousChannel, ThreadLocalChannel

public interface BlockingTarget
extends MessageTarget

Extends MessageTarget and provides a timeout-aware send method.

Author:
Mark Fisher

Method Summary
 boolean send(Message<?> message)
          Send a message, blocking indefinitely if necessary.
 boolean send(Message<?> message, long timeout)
          Send a message, blocking until either the message is accepted or the specified timeout period elapses.
 

Method Detail

send

boolean send(Message<?> message)
Send a message, blocking indefinitely if necessary.

Specified by:
send in interface MessageTarget
Parameters:
message - the Message to send
Returns:
true if the message is sent successfully, false if interrupted

send

boolean send(Message<?> message,
             long timeout)
Send a message, blocking until either the message is accepted or the specified timeout period elapses.

Parameters:
message - the Message to send
timeout - the timeout in milliseconds
Returns:
true if the message is sent successfully, false if the specified timeout period elapses or the send is interrupted