rmi test hello world

This commit is contained in:
2014-11-16 18:35:27 +01:00
parent b2d75ffed6
commit bc03a1f378
5 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
package rmi_hello_world;
import java.rmi.Naming;
import java.rmi.RMISecurityManager;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.logging.Logger;
/**
* Created by Giovanni on 09/11/2014.
*/
public class Launch {
public static void main (String[] arg){
Logger l =Logger.getLogger("hellowordlogger");
System.setSecurityManager(new RMISecurityManager());
try {
Registry registry = LocateRegistry.createRegistry(10000);
HelloWorldImpl obj = new HelloWorldImpl();
l.info("Creato oggetto");
registry.bind("HW",obj);
l.info("Oggetto registrato");
}
catch (Exception e){
e.printStackTrace();
}
}
}