1 22 package org.jboss.mq.server; 23 24 import javax.jms.JMSException ; 25 26 import org.jboss.mq.SpyTopic; 27 import org.jboss.mq.pm.Tx; 28 import org.jboss.mq.selectors.Selector; 29 30 38 public class SelectorPersistentQueue 39 extends PersistentQueue 40 { 41 43 46 String selectorString; 47 48 51 Selector selector; 52 53 55 63 public SelectorPersistentQueue(JMSDestinationManager server, SpyTopic dstopic, String selector, BasicQueueParameters parameters) 64 throws JMSException 65 { 66 super(server, dstopic, parameters); 67 this.selectorString = selector; 68 this.selector = new Selector(selector); 69 } 70 71 73 80 public void addMessage(MessageReference mesRef, Tx txId) 81 throws JMSException 82 { 83 if (selector.test(mesRef.getHeaders())) 84 super.addMessage( mesRef, txId ); 85 else 86 server.getMessageCache().remove(mesRef); 87 } 88 } 89 | Popular Tags |