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