public class NullChannel extends java.lang.Object implements PollableChannel
| Constructor and Description |
|---|
NullChannel() |
| Modifier and Type | Method and Description |
|---|---|
Message<?> |
receive()
Receive a message from this channel, blocking indefinitely if necessary.
|
Message<?> |
receive(long timeout)
Receive a message from this channel, blocking until either a message is
available or the specified timeout period elapses.
|
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.
|
public boolean send(Message<?> message)
MessageChannelMessage 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 MessageChannel.send(Message, long).
send in interface MessageChannelmessage - the Message to sendpublic boolean send(Message<?> message, long timeout)
MessageChannelsend in interface MessageChannelmessage - the Message to sendtimeout - the timeout in millisecondstrue if the message is sent successfully,
false if the specified timeout period elapses or
the send is interruptedpublic Message<?> receive()
PollableChannelreceive in interface PollableChannelMessage or null if interruptedpublic Message<?> receive(long timeout)
PollableChannelreceive in interface PollableChanneltimeout - the timeout in millisecondsMessage or null if the
specified timeout period elapses or the message reception is interrupted