import java.rmi.*;
import java.net.*;

/** Creates a RemoteIntegralImpl object and registers it under
 *  the name 'RemoteIntegral' so that remote clients can connect
 *  to it for numeric integration results. The idea is to place
 *  this server on a workstation with very fast floating-point
 *  capabilities, while slower interfaces can run on smaller
 *  computers but still use the integration routines.
 *
 *  Taken from Core Web Programming from 
 *  Prentice Hall and Sun Microsystems Press,
 *  http://www.corewebprogramming.com/.
 *  &copy; 2001 Marty Hall and Larry Brown;
 *  may be freely used or adapted. 
 */

public class RemoteIntegralServer {
  public static void main(String[] args) {
    try {
      RemoteIntegralImpl integral =  new RemoteIntegralImpl();
      Naming.rebind("rmi:///RemoteIntegral", integral);
    } catch(RemoteException re) {
      System.out.println("RemoteException: " + re);
    } catch(MalformedURLException mfe) {
      System.out.println("MalformedURLException: " + mfe);
    }
  }
}