1 25 package org.objectweb.joram.client.jms.tcp; 26 27 import org.objectweb.joram.client.jms.Connection; 28 import org.objectweb.joram.client.jms.FactoryParameters; 29 import org.objectweb.joram.client.jms.admin.AdminModule; 30 31 import java.util.Vector ; 32 33 import javax.naming.NamingException ; 34 35 import org.objectweb.joram.shared.JoramTracing; 36 import org.objectweb.util.monolog.api.BasicLevel; 37 38 42 public class TcpConnectionFactory extends org.objectweb.joram.client.jms.ConnectionFactory { 43 49 public TcpConnectionFactory(String host, int port) { 50 super(host, port); 51 } 52 53 56 public TcpConnectionFactory() {} 57 58 64 public javax.jms.Connection createConnection(String name, String password) 65 throws javax.jms.JMSException { 66 if (JoramTracing.dbgClient.isLoggable(BasicLevel.DEBUG)) 67 JoramTracing.dbgClient.log(BasicLevel.DEBUG, 68 "TcpConnectionFactory.createConnection(" + 69 name + ',' + password + ") reliableClass=" + reliableClass); 70 71 return new Connection(params, 72 new TcpConnection(params, 73 name, 74 password, 75 reliableClass)); 76 } 77 78 85 public static javax.jms.ConnectionFactory create(String host, int port) { 86 return create(host, 87 port, 88 "org.objectweb.joram.client.jms.tcp.ReliableTcpClient"); 89 } 90 91 99 public static javax.jms.ConnectionFactory 100 create(String host, 101 int port, 102 String reliableClass) { 103 if (JoramTracing.dbgClient.isLoggable(BasicLevel.DEBUG)) 104 JoramTracing.dbgClient.log( 105 BasicLevel.DEBUG, 106 "TcpConnectionFactory.create(" + 107 host + ',' + port + ',' + reliableClass +')'); 108 TcpConnectionFactory cf = new TcpConnectionFactory(host, port); 109 cf.setReliableClass(reliableClass); 110 return cf; 111 } 112 113 119 public static javax.jms.ConnectionFactory create() 120 throws java.net.ConnectException 121 { 122 return create(AdminModule.getLocalHost(), AdminModule.getLocalPort()); 123 } 124 } 125 | Popular Tags |