creato rmi counter. verifica blanda di errori di input

This commit is contained in:
2014-11-17 00:46:26 +01:00
parent bc03a1f378
commit f17671da1c
11 changed files with 259 additions and 8 deletions

View File

@@ -0,0 +1,39 @@
package rmi_hello_world;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.logging.Logger;
/**
* Created by Giovanni on 16/11/2014.
*/
public class LaunchClient {
private static final Logger l = Logger.getLogger("Client");
public static void main (String[] arg) {
try {
l.info("Cercando l'oggetto remoto");
HelloWorldInterface o = (HelloWorldInterface) Naming.lookup("rmi://localhost/HW");
l.info("Found");
l.info(o.stampa());
} catch (RemoteException e) {
e.printStackTrace();
} catch (NotBoundException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
}