1 24 package com.scalagent.kjoram; 25 26 import java.util.Vector ; 27 import java.util.Hashtable ; 28 29 import com.scalagent.kjoram.excepts.JMSException; 30 31 32 public abstract class ConnectionFactory 33 extends com.scalagent.kjoram.admin.AdministeredObject 34 { 35 36 protected FactoryParameters params; 37 38 39 45 public ConnectionFactory(String host, int port) 46 { 47 super(host + ":" + port); 48 params = new FactoryParameters(host, port); 49 50 if (JoramTracing.dbgClient) 51 JoramTracing.log(JoramTracing.DEBUG, this + ": created."); 52 } 53 54 57 public ConnectionFactory() 58 {} 59 60 61 62 public String toString() 63 { 64 return "CF:" + params.getHost() + "-" + params.getPort(); 65 } 66 67 68 74 public abstract Connection 75 createConnection(String name, String password) 76 throws JMSException; 77 78 85 public Connection createConnection() throws JMSException 86 { 87 return createConnection("anonymous", "anonymous"); 88 } 89 90 93 public FactoryParameters getParameters() 94 { 95 return params; 96 } 97 98 public void setParameters(FactoryParameters params) { 99 this.params = params; 100 } 101 102 106 public Hashtable code() { 107 Hashtable h = super.code(); 108 h.put("host",params.getHost()); 109 h.put("port",new Integer (params.getPort())); 110 h.put("connectingTimer",new Integer (params.connectingTimer)); 111 h.put("txPendingTimer",new Integer (params.txPendingTimer)); 112 h.put("cnxPendingTimer",new Integer (params.soapCnxPendingTimer)); 113 return h; 114 } 115 116 public static Object decode(Hashtable h) { 117 return null; 118 } 119 } 120 | Popular Tags |