1 26 27 package org.objectweb.benchmark.rmi.latency; 28 29 30 import java.rmi.Naming ; 32 33 40 public class Server 41 { 42 48 49 private String host; 50 51 57 60 public Server() 61 { 62 try 63 { 64 java.util.Properties properties = new java.util.Properties (); 65 java.io.InputStream propStream = getClass().getClassLoader().getResourceAsStream("benchmark.properties"); 66 properties.load(propStream); 67 68 host = properties.getProperty("com.host"); 69 }catch(Exception e){ 70 e.printStackTrace(); 71 } 72 } 73 74 80 86 89 public static void main(String [] args) 90 { 91 Server s = new Server(); 92 93 try 94 { 95 PingImpl obj = new PingImpl(); 96 Naming.rebind("pingServer", obj); 97 System.out.println("Ping server ready ..."); 98 } catch(Exception e) { 99 e.printStackTrace(); 100 } 101 } 102 } | Popular Tags |