//This class was created automatically by CentiJ
package rmi.rmiSynth;

import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class RMIClient {


  public static void main(String args[]) {
    try {
      example();

    } catch (Exception e) {
      e.printStackTrace();
    }

  }

  private static void example() throws RemoteException, NotBoundException {
    RMIInterface rs = getProxy();
    //Type in your remote procedure calls below
    System.out.println(rs.getHello());
  }

  private static RMIInterface getProxy() throws RemoteException, NotBoundException {
    Registry r = getRegistry();
    RMIInterface rs = (RMIInterface) r.lookup(RMIInterface.SERVER_NAME);
    return rs;
  }

  private static Registry getRegistry() throws RemoteException {
    //locate the server class on remote machine
    Registry r = LocateRegistry.getRegistry("localhost");
    return r;
  }

}