1 24 25 package org.objectweb.jonas_jms; 26 27 import javax.jms.ConnectionConsumer ; 28 import javax.jms.JMSException ; 29 import javax.jms.ServerSessionPool ; 30 import javax.jms.Topic ; 31 import javax.jms.TopicConnection ; 32 import javax.jms.TopicSession ; 33 import javax.jms.XAConnection ; 34 import javax.jms.XATopicConnection ; 35 import javax.jms.XATopicConnectionFactory ; 36 37 import org.objectweb.util.monolog.api.BasicLevel; 38 39 47 48 public class JTopicConnection extends JConnection implements TopicConnection { 49 50 protected XATopicConnection xatc = null; 52 53 54 60 public JTopicConnection(JConnectionFactory jcf, XATopicConnectionFactory xatcf, String user, String passwd) throws JMSException { 61 super(jcf, user); 62 xatc = xatcf.createXATopicConnection(user, passwd); 64 this.xac = (XAConnection ) xatc; 65 } 66 67 70 public JTopicConnection(JConnectionFactory jcf, XATopicConnectionFactory xatcf) throws JMSException { 71 super(jcf, INTERNAL_USER_NAME); 72 xatc = xatcf.createXATopicConnection(); 74 this.xac = (XAConnection ) xatc; 75 } 76 77 81 90 public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException { 91 TraceJms.logger.log(BasicLevel.DEBUG, ""); 92 return new JTopicSession(this, xatc); 93 } 94 95 98 public ConnectionConsumer createConnectionConsumer(Topic topic, 99 String messageSelector, 100 ServerSessionPool sessionPool, 101 int maxMessages) throws JMSException { 102 TraceJms.logger.log(BasicLevel.DEBUG, ""); 103 return xatc.createConnectionConsumer(topic, messageSelector, sessionPool, maxMessages); 104 } 105 } 106 | Popular Tags |