1 26 27 package org.objectweb.benchmark.xmlrpc.latency; 28 29 import org.apache.xmlrpc.WebServer; 31 32 39 public class Server 40 { 41 47 48 private String port; 49 50 56 59 public Server() 60 { 61 try 62 { 63 java.util.Properties properties = new java.util.Properties (); 64 java.io.InputStream propStream = getClass().getClassLoader().getResourceAsStream("benchmark.properties"); 65 properties.load(propStream); 66 67 port = "2000"; 68 }catch(Exception e){ 69 e.printStackTrace(); 70 } 71 } 72 73 79 private String 80 getPort() 81 { 82 return port; 83 } 84 85 91 94 public static void 95 main(String [] args) 96 { 97 Server s = new Server(); 98 99 try 100 { 101 WebServer server = new WebServer(Integer.parseInt(s.getPort())); 102 System.out.println ("Ping Server started ..."); 103 server.addHandler ("pingServer", new PingHandler ()); 104 } catch (java.io.IOException e) { 105 e.printStackTrace(); 106 } 107 } 108 } 109 | Popular Tags |