1 24 25 package org.objectweb.jonas_jms; 26 27 import javax.jms.JMSException ; 28 import javax.jms.TopicConnection ; 29 import javax.jms.TopicConnectionFactory ; 30 import javax.jms.XATopicConnectionFactory ; 31 32 import org.objectweb.util.monolog.api.BasicLevel; 33 34 43 public class JTopicConnectionFactory extends JConnectionFactory implements TopicConnectionFactory { 44 45 private XATopicConnectionFactory xatcf; 46 47 51 public JTopicConnectionFactory(String name) { 52 this.name = name; 53 jms = JmsManagerImpl.getJmsManager(); 54 xacf = jms.getXATopicConnectionFactory(); 55 xatcf = (XATopicConnectionFactory ) xacf; 56 } 57 58 62 71 public TopicConnection createTopicConnection() throws JMSException { 72 TraceJms.logger.log(BasicLevel.DEBUG,""); 75 JTopicConnection tc = (JTopicConnection) getJConnection(); 76 if (tc == null) { 77 tc = new JTopicConnection(this, xatcf); 78 } 79 return (TopicConnection ) tc; 80 } 81 82 95 public TopicConnection createTopicConnection(String userName, String password) 96 throws JMSException { 97 TraceJms.logger.log(BasicLevel.DEBUG,""); 98 JTopicConnection tc = (JTopicConnection) getJConnection(userName); 101 if (tc == null) { 102 tc = new JTopicConnection(this, xatcf, userName, password); 103 } 104 return (TopicConnection ) tc; 105 } 106 107 } 108 | Popular Tags |