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

public class Server implements RemoteInterface
{
    public String getMessage()
    {
        return "Hello World";
    }

    public static void main(String args[])
    {
        try
        {
            Registry registry = LocateRegistry.getRegistry(RemoteInterface.REGISTRY_PORT);
            RemoteInterface remoteReference = 
                (RemoteInterface) UnicastRemoteObject.exportObject(new Server());
            registry.rebind(RemoteInterface.REGISTRY_NAME, remoteReference);
        }
        catch (Exception e)
        {
            throw new RuntimeException(e);
        }
    }
}
