|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.channel.AbstractMessageChannel org.springframework.integration.channel.AbstractPollableChannel org.springframework.integration.channel.QueueChannel
public class QueueChannel
Simple implementation of a message channel. Each Message
is placed in
a BlockingQueue
whose capacity may be specified upon construction.
The capacity must be a positive integer value. For a zero-capacity version
based upon a SynchronousQueue
, consider the
RendezvousChannel
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.springframework.integration.channel.AbstractMessageChannel |
---|
AbstractMessageChannel.ChannelInterceptorList |
Constructor Summary | |
---|---|
QueueChannel()
Create a channel with "unbounded" queue capacity. |
|
QueueChannel(java.util.concurrent.BlockingQueue<Message<?>> queue)
Create a channel with the specified queue. |
|
QueueChannel(int capacity)
Create a channel with the specified queue capacity. |
Method Summary | |
---|---|
java.util.List<Message<?>> |
clear()
Remove all Messages from this channel. |
protected Message<?> |
doReceive(long timeout)
Subclasses must implement this method. |
protected boolean |
doSend(Message<?> message,
long timeout)
Subclasses must implement this method. |
int |
getMesssageCount()
|
int |
getRemainingCapacity()
|
java.util.List<Message<?>> |
purge(MessageSelector selector)
Remove any Messages that are not accepted by the provided selector. |
Methods inherited from class org.springframework.integration.channel.AbstractPollableChannel |
---|
receive, receive |
Methods inherited from class org.springframework.integration.channel.AbstractMessageChannel |
---|
addInterceptor, getInterceptors, getName, send, send, setBeanName, setInterceptors, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.integration.core.MessageChannel |
---|
getName, send, send |
Constructor Detail |
---|
public QueueChannel(java.util.concurrent.BlockingQueue<Message<?>> queue)
public QueueChannel(int capacity)
public QueueChannel()
Integer.MAX_VALUE
. Note that a bounded queue is recommended, since an
unbounded queue may lead to OutOfMemoryErrors.
Method Detail |
---|
protected boolean doSend(Message<?> message, long timeout)
AbstractMessageChannel
doSend
in class AbstractMessageChannel
protected Message<?> doReceive(long timeout)
AbstractPollableChannel
doReceive
in class AbstractPollableChannel
public java.util.List<Message<?>> clear()
PollableChannel
Messages
from this channel.
public java.util.List<Message<?>> purge(MessageSelector selector)
PollableChannel
Messages
that are not accepted by the provided selector.
public int getMesssageCount()
public int getRemainingCapacity()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |