00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 package org.objectweb.jonas_jms;
00026
00027 import javax.jms.JMSException;
00028 import javax.jms.TopicConnection;
00029 import javax.jms.TopicConnectionFactory;
00030 import javax.jms.XATopicConnectionFactory;
00031
00032 import org.objectweb.util.monolog.api.BasicLevel;
00033
00043 public class JTopicConnectionFactory extends JConnectionFactory implements TopicConnectionFactory {
00044
00045 private XATopicConnectionFactory xatcf;
00046
00051 public JTopicConnectionFactory(String name) {
00052 this.name = name;
00053 jms = JmsManagerImpl.getJmsManager();
00054 xacf = jms.getXATopicConnectionFactory();
00055 xatcf = (XATopicConnectionFactory) xacf;
00056 }
00057
00058
00059
00060
00061
00071 public TopicConnection createTopicConnection() throws JMSException {
00072
00073
00074 TraceJms.logger.log(BasicLevel.DEBUG,"");
00075 JTopicConnection tc = (JTopicConnection) getJConnection();
00076 if (tc == null) {
00077 tc = new JTopicConnection(this, xatcf);
00078 }
00079 return (TopicConnection) tc;
00080 }
00081
00095 public TopicConnection createTopicConnection(String userName, String password)
00096 throws JMSException {
00097 TraceJms.logger.log(BasicLevel.DEBUG,"");
00098
00099
00100 JTopicConnection tc = (JTopicConnection) getJConnection(userName);
00101 if (tc == null) {
00102 tc = new JTopicConnection(this, xatcf, userName, password);
00103 }
00104 return (TopicConnection) tc;
00105 }
00106
00107 }