<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package integral;

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

public class Server {
	public static void main(String[] args) {
        try {
        	IntegralService trapIntegral = new TrapezoidalQuadrature(Double.valueOf(args[0]));
            IntegralService trapStub =
                (IntegralService) UnicastRemoteObject.exportObject(trapIntegral, 0);
            Registry registry = LocateRegistry.getRegistry();
            registry.rebind("Trapezoidal", trapStub);
            System.out.println("TrapezoidalQuadrature bound");
        } catch (Exception e) {
            System.err.println("TrapezoidalQuadrature exception:");
            e.printStackTrace();
        }
        try {
            IntegralService simpIntegral = new SimpsonQuadrature(Double.valueOf(args[0]));
            IntegralService simpStub =
                (IntegralService) UnicastRemoteObject.exportObject(simpIntegral, 0);
            Registry registry = LocateRegistry.getRegistry();
            registry.rebind("Simpson", simpStub);
            System.out.println("SimpsonQuadrature bound");
        } catch (Exception e) {
            System.err.println("SimpsonQuadrature exception:");
            e.printStackTrace();
        }

	}

}
</pre></body></html>