1 9 10 import java.util.Properties ; 11 12 import org.uddi4j.transport.TransportFactory; 13 14 24 25 public class Configurator { 26 27 33 public static Properties load() { 34 Properties config = new Properties (); 35 try { 36 config.load(new java.io.FileInputStream ("samples.prop")); 37 } catch (Exception e) { 38 System.out.println("Error loading samples property file\n" + e); 39 } 40 41 if (System.getProperty(TransportFactory.PROPERTY_NAME)==null) { 44 System.setProperty(TransportFactory.PROPERTY_NAME, config.getProperty("TransportClassName")); 45 } 46 if (System.getProperty("org.uddi4j.logEnabled")==null) { 48 System.setProperty("org.uddi4j.logEnabled", config.getProperty("logEnabled")); 49 } 50 51 try { 53 System.setProperty("java.protocol.handler.pkgs", config.getProperty("handlerPackageName")); 54 55 java.security.Security.addProvider((java.security.Provider ) 57 Class.forName(config.getProperty("securityClassName")).newInstance()); 58 } catch (Exception e) { 59 System.out.println("Error configuring JSSE provider. Make sure JSSE is in classpath.\n" + e); 60 } 61 return config; 62 } 63 } 64 | Popular Tags |