|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.context.IntegrationObjectSupport 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 |
Field Summary |
---|
Fields inherited from class org.springframework.integration.channel.AbstractMessageChannel |
---|
logger |
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 |
getQueueSize()
Return the current number of queued Messages in this channel. |
int |
getRemainingCapacity()
Return the remaining capacity of this channel. |
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, getComponentType, getFullChannelName, getInterceptors, send, send, setConversionService, setDatatypes, setInterceptors, setShouldTrack |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, onInit, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setTaskScheduler, 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.MessageChannel |
---|
send, send |
Methods inherited from interface org.springframework.integration.context.NamedComponent |
---|
getComponentName |
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()
Messages
from this channel.
clear
in interface QueueChannelOperations
public java.util.List<Message<?>> purge(MessageSelector selector)
Messages
that are not accepted by the provided selector.
purge
in interface QueueChannelOperations
public int getQueueSize()
QueueChannelOperations
Messages
in this channel.
getQueueSize
in interface QueueChannelOperations
public int getRemainingCapacity()
QueueChannelOperations
getRemainingCapacity
in interface QueueChannelOperations
|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |