1 24 25 package org.objectweb.jonas_jms; 26 27 import javax.jms.ConnectionConsumer ; 28 import javax.jms.JMSException ; 29 import javax.jms.Queue ; 30 import javax.jms.QueueConnection ; 31 import javax.jms.QueueSession ; 32 import javax.jms.ServerSessionPool ; 33 import javax.jms.XAConnection ; 34 import javax.jms.XAQueueConnection ; 35 import javax.jms.XAQueueConnectionFactory ; 36 37 import org.objectweb.util.monolog.api.BasicLevel; 38 39 47 48 public class JQueueConnection extends JConnection implements QueueConnection { 49 50 protected XAQueueConnection xaqc = null; 52 53 54 60 public JQueueConnection(JConnectionFactory jcf, 61 XAQueueConnectionFactory xaqcf, 62 String user, String passwd) throws JMSException { 63 super(jcf, user); 64 65 xaqc = xaqcf.createXAQueueConnection(user, passwd); 67 this.xac = (XAConnection ) xaqc; 68 } 69 70 73 public JQueueConnection(JConnectionFactory jcf, XAQueueConnectionFactory xaqcf) 74 throws JMSException { 75 76 super(jcf, INTERNAL_USER_NAME); 77 xaqc = xaqcf.createXAQueueConnection(); 78 this.xac = (XAConnection ) xaqc; 79 } 80 81 85 98 public ConnectionConsumer createConnectionConsumer(Queue queue, 99 String selector, 100 ServerSessionPool pool, 101 int maxmessages) throws JMSException { 102 TraceJms.logger.log(BasicLevel.DEBUG, ""); 103 return xaqc.createConnectionConsumer(queue, selector, pool, maxmessages); 104 } 105 106 115 public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException { 116 TraceJms.logger.log(BasicLevel.DEBUG, ""); 117 return new JQueueSession(this, xaqc); 118 } 119 } 120 | Popular Tags |