org.springframework.integration.channel
Class ChannelPurger

java.lang.Object
  extended by org.springframework.integration.channel.ChannelPurger

public class ChannelPurger
extends java.lang.Object

A utility class for purging Messages from one or more QueueChannels. Any message that does not match the provided MessageSelector will be removed from the channel. If no MessageSelector is provided, then all messages will be cleared from the channel.

Note that the purge() method operates on a snapshot of the messages within a channel at the time that the method is invoked. It is therefore possible that new messages will arrive on the channel during the purge operation and thus will not be removed. Likewise, messages to be purged may have been removed from the channel while the operation is taking place. Such messages will not be included in the returned list.


Constructor Summary
ChannelPurger(MessageSelector selector, QueueChannel... channels)
           
ChannelPurger(QueueChannel... channels)
           
 
Method Summary
 java.util.List<Message<?>> purge()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelPurger

public ChannelPurger(QueueChannel... channels)

ChannelPurger

public ChannelPurger(MessageSelector selector,
                     QueueChannel... channels)
Method Detail

purge

public final java.util.List<Message<?>> purge()