|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.channel.NullChannel
public class NullChannel
A channel implementation that essentially behaves like "/dev/null". All receive() calls will return null, and all send() calls will return true although no action is performed. Note however that the invocations are logged at debug-level.
Constructor Summary | |
---|---|
NullChannel()
|
Method Summary | |
---|---|
java.util.List<Message<?>> |
clear()
Remove all Messages from this channel. |
java.lang.String |
getName()
Return the name of this channel. |
java.util.List<Message<?>> |
purge(MessageSelector selector)
Remove any Messages that are not accepted by the provided selector. |
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. |
void |
setBeanName(java.lang.String beanName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NullChannel()
Method Detail |
---|
public void setBeanName(java.lang.String beanName)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public java.lang.String getName()
MessageChannel
getName
in interface MessageChannel
public java.util.List<Message<?>> clear()
PollableChannel
Messages
from this channel.
clear
in interface PollableChannel
public java.util.List<Message<?>> purge(MessageSelector selector)
PollableChannel
Messages
that are not accepted by the provided selector.
purge
in interface PollableChannel
public Message<?> receive()
PollableChannel
receive
in interface PollableChannel
Message
or null
if
interruptedpublic Message<?> receive(long timeout)
PollableChannel
receive
in interface PollableChannel
timeout
- the timeout in milliseconds
Message
or null
if the
specified timeout period elapses or the message reception is interruptedpublic boolean send(Message<?> message)
MessageChannel
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 MessageChannel.send(Message, long)
.
send
in interface MessageChannel
message
- the Message
to send
public boolean send(Message<?> message, long timeout)
MessageChannel
send
in interface MessageChannel
message
- the Message
to sendtimeout
- the timeout in milliseconds
true
if the message is sent successfully,
false if the specified timeout period elapses or
the send is interrupted
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |