Pessoal, preciso criar o método shutdown, para ele finalizar o servidor assim que o cálculo for terminado.
Se alguem puder me ajudar.
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.;
import javax.swing.;
public class SomaClient {
private SomaClient() {}
public static void main(String[] args) {
int x,y,z;
String host = (args.length < 1) ? null : args[0]; // interface
try {
Registry registry = LocateRegistry.getRegistry(host);
Soma stub = (Soma) registry.lookup("Soma");
String opc1=JOptionPane.showInputDialog("Digite a o valor 1 com peso 3");
x= Integer.parseInt(opc1);
String opc2=JOptionPane.showInputDialog("Digite a o valor 2 com peso 3");
y= Integer.parseInt(opc2);
String opc3=JOptionPane.showInputDialog("Digite a o valor 3 com peso 4");
z= Integer.parseInt(opc3);
int response = stub.soma(x,y);
System.out.println("resposta: " + response);
} catch (Exception e) {
System.err.println("Exceção do Cliente: " + e.toString());
e.printStackTrace();
}
}
}