1 7 package org.jboss.mq.il.oil; 8 9 import java.util.Properties ; 10 11 import org.jboss.mq.il.ServerIL; 12 import org.jboss.mq.il.ServerILFactory; 13 import java.net.InetAddress ; 14 15 21 public final class OILServerILFactory 22 implements ServerILFactory 23 { 24 25 final public static String SERVER_IL_FACTORY = OILServerILFactory.class.getName(); 26 final public static String CLIENT_IL_SERVICE = OILClientILService.class.getName(); 27 final public static String OIL_ADDRESS_KEY = "OIL_ADDRESS_KEY"; 28 final public static String OIL_PORT_KEY = "OIL_PORT_KEY"; 29 final public static String OIL_TCPNODELAY_KEY = "OIL_TCPNODELAY_KEY"; 30 31 private ServerIL serverIL; 32 33 36 public void init(Properties props) 37 throws Exception 38 { 39 40 String t = props.getProperty(OIL_ADDRESS_KEY); 41 if (t == null) 42 throw new javax.jms.JMSException ("A required connection property was not set: " + OIL_ADDRESS_KEY); 43 InetAddress address = InetAddress.getByName(t); 44 45 t = props.getProperty(OIL_PORT_KEY); 46 if (t == null) 47 throw new javax.jms.JMSException ("A required connection property was not set: " + OIL_PORT_KEY); 48 int port = Integer.parseInt(t); 49 50 boolean enableTcpNoDelay=false; 51 t = props.getProperty(OIL_TCPNODELAY_KEY); 52 if (t != null) 53 enableTcpNoDelay = t.equals("yes"); 54 55 String clientSocketFactoryName = null; 56 serverIL = new OILServerIL(address, port, clientSocketFactoryName, enableTcpNoDelay); 57 58 } 59 60 63 public ServerIL getServerIL() 64 throws Exception 65 { 66 return serverIL; 67 } 68 69 } 70 | Popular Tags |