1 22 package org.jboss.mq.server; 23 24 import javax.jms.DeliveryMode ; 25 import javax.jms.JMSException ; 26 27 import org.jboss.mq.ConnectionToken; 28 import org.jboss.mq.SpyMessage; 29 import org.jboss.mq.TransactionRequest; 30 31 37 public class NonPersistentInterceptor extends JMSServerInterceptorSupport 38 { 39 41 43 45 47 49 51 public void addMessage(ConnectionToken dc, SpyMessage message) throws JMSException 52 { 53 makeNonPersistent(message); 54 super.addMessage(dc, message); 55 } 56 57 public void transact(ConnectionToken dc, TransactionRequest t) throws JMSException 58 { 59 if (t.messages != null) 60 { 61 for (int i = 0; i < t.messages.length; ++i) 62 makeNonPersistent(t.messages[i]); 63 } 64 super.transact(dc, t); 65 } 66 67 69 75 protected void makeNonPersistent(SpyMessage message) throws JMSException 76 { 77 message.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT); 78 } 79 80 82 84 } 86 | Popular Tags |