/*
 * This Java source file was generated by the Gradle 'init' task.
 */
package train.rmi;

import train.rmi.remote.impl.RemoteHello;

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

public class Server {

    public static void main(String[] args) {

        try{
            String name = "Hello";
            RemoteHello h = new RemoteHello();
            LocateRegistry.createRegistry(1099);
            Registry registry = LocateRegistry.getRegistry();
            registry.rebind(name, h);
            System.out.println("Hello obj bound");
        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
