1 24 package com.scalagent.kjoram.ksoap; 25 26 import com.scalagent.kjoram.Connection; 27 import com.scalagent.kjoram.FactoryParameters; 28 import com.scalagent.kjoram.excepts.*; 29 30 import java.util.Vector ; 31 import java.util.Hashtable ; 32 33 34 38 public class SoapConnectionFactory extends com.scalagent.kjoram.ConnectionFactory 39 { 40 48 public SoapConnectionFactory(String host, int port, int timeout) 49 { 50 super(host, port); 51 params.soapCnxPendingTimer = timeout; 52 } 53 54 57 public SoapConnectionFactory() 58 {} 59 60 61 67 public Connection createConnection(String name, String password) 68 throws JMSException 69 { 70 return new Connection(params, new SoapConnection(params, name, password)); 71 } 72 73 public static Object decode(Hashtable h) { 74 SoapConnectionFactory ret = new SoapConnectionFactory(); 75 FactoryParameters params = 76 new FactoryParameters((String ) h.get("host"), 77 ((Integer ) h.get("port")).intValue()); 78 params.connectingTimer = ((Integer ) h.get("connectingTimer")).intValue(); 79 params.txPendingTimer = ((Integer ) h.get("txPendingTimer")).intValue(); 80 params.soapCnxPendingTimer = ((Integer ) h.get("cnxPendingTimer")).intValue(); 81 ret.setParameters(params); 82 ret.setId(ret.getClass().getName() + ":" + 83 params.getHost()+ ":" + params.getPort()); 84 ret.addInstanceTable(ret.getId(), ret); 85 return ret; 86 } 87 } 88 | Popular Tags |