FileDocCategorySizeDatePackage
HelloImpl.javaAPI DocExample699Thu Apr 03 15:28:34 BST 1997None

HelloImpl.java

import java.rmi.*;
import java.rmi.server.*;
import java.net.*;

public class HelloImpl extends UnicastRemoteObject implements Hello {

  public HelloImpl() throws RemoteException {
    super();
  }
    
  public String sayHello() throws RemoteException {
    return "Hello, World!";
  }

  public static void main(String args[]) {

    try {
      HelloImpl h = new HelloImpl();
      Naming.rebind("hello", h);
      System.out.println("Hello Server ready.");
    }
     catch (RemoteException re) {
      System.out.println("Exception in HelloImpl.main: " + re);
    }
    catch (MalformedURLException e) {
      System.out.println("MalformedURLException in HelloImpl.main: " + e);
    }

  }

}