// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class ClientImpl extends UnicastRemoteObject implements Client {
   public ClientImpl() throws RemoteException {
   }
   public void notify(String msg) {
      System.out.println(msg);
   }
   public static void main(String[] args) {
      try {
         Server srv = (Server) Naming.lookup("test");
         srv.register(new ClientImpl());
         System.out.println(srv.dup("a"));
         System.out.println(srv.dup("bb"));
         System.out.println(srv.dup("ccc"));
      } catch (MalformedURLException e) {
         e.printStackTrace();
      } catch (RemoteException e) {
         e.printStackTrace();
      } catch (NotBoundException e) {
         e.printStackTrace();
      }
   }
}
