| 1 package com.ubermq.jms.client; 2 3 import com.ubermq.jms.client.impl.*; 4 import com.ubermq.jms.client.multicast.*; 5 import java.net.*; 6 import javax.jms.*; 7 8 12 public class MulticastTopicConnectionFactory 13 implements javax.jms.TopicConnectionFactory , java.io.Serializable  14 { 15 private SocketAddress addr; 16 17 public static final long serialVersionUID = 1L; 18 19 25 public MulticastTopicConnectionFactory(String host, int port) 26 { 27 this.addr = new InetSocketAddress(host, port); 28 } 29 30 public MulticastTopicConnectionFactory(URI uri) 31 { 32 this(uri.getHost(), 33 (uri.getPort() > 0) ? uri.getPort() : com.ubermq.jms.common.MessageConstants.DEFAULT_PORT); 34 } 35 36 public javax.jms.TopicConnection createTopicConnection() 37 throws JMSException 38 { 39 try { 40 return new MulticastTopicConnection(new SimpleInternetConnectionDescriptor(addr)); 41 } catch(Exception x) {throw new JMSException(x.toString());} 42 } 43 44 public javax.jms.TopicConnection createTopicConnection(String p0, String p1) 45 throws JMSException 46 { 47 return createTopicConnection(); 48 } 49 50 public javax.jms.Connection createConnection(String p0, String p1) throws JMSException 51 { 52 return createTopicConnection(p0, p1); 53 } 54 55 public javax.jms.Connection createConnection() throws JMSException 56 { 57 return createTopicConnection(); 58 } 59 60 61 } 62 | Popular Tags |