org.springframework.integration.channel
Interface MessageChannel

All Known Implementing Classes:
SimpleChannel

public interface MessageChannel

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

Author:
Mark Fisher

Method Summary
 DispatcherPolicy getDispatcherPolicy()
          Return this channel's dispatcher policy
 java.lang.String getName()
          Return the name of this channel.
 Message receive()
          Receive a message, blocking indefinitely if necessary.
 Message receive(long timeout)
          Receive a message, blocking until either a message is available or the specified timeout period elapses.
 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.
 void setName(java.lang.String name)
          Set the name of this channel.
 

Method Detail

getName

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


setName

void setName(java.lang.String name)
Set the name of this channel.


getDispatcherPolicy

DispatcherPolicy getDispatcherPolicy()
Return this channel's dispatcher policy


send

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

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

receive

Message receive()
Receive a message, blocking indefinitely if necessary.

Returns:
the next available Message or null if interrupted

receive

Message receive(long timeout)
Receive a message, blocking until either a message is available or the specified timeout period elapses.

Parameters:
timeout - the timeout in milliseconds
Returns:
the next available Message or null if the specified timeout period elapses or the message reception is interrupted