org.springframework.integration.core
Interface MessageChannel

All Known Subinterfaces:
ControlBus, PollableChannel, SubscribableChannel
All Known Implementing Classes:
AbstractMessageChannel, AbstractPollableChannel, AbstractSubscribableChannel, DirectChannel, ExecutorChannel, JmsDestinationBackedMessageChannel, NullChannel, PriorityChannel, PublishSubscribeChannel, QueueChannel, RendezvousChannel, ThreadLocalChannel

public interface MessageChannel

Base channel interface defining common behavior for message sending and receiving.

Author:
Mark Fisher

Method Summary
 java.lang.String getName()
          Return the name of this channel.
 boolean send(Message<?> message)
          Send a Message to this channel.
 boolean send(Message<?> message, long timeout)
          Send a message, blocking until either the message is accepted or the specified timeout period elapses.
 

Method Detail

getName

java.lang.String getName()
Return the name of this channel.


send

boolean send(Message<?> message)
Send a Message to this channel. May throw a RuntimeException for non-recoverable errors. Otherwise, if the Message cannot be sent for a non-fatal reason this method will return 'false', and if the Message is sent successfully, it will return 'true'.

Depending on the implementation, this method may block indefinitely. To provide a maximum wait time, use send(Message, long).

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

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