1 24 25 package utobcast; 26 27 import java.net.InetAddress ; 28 29 import org.objectweb.fractal.rmi.registry.NamingService; 30 import org.objectweb.fractal.rmi.registry.Registry; 31 import org.objectweb.fractal.util.Fractal; 32 33 36 public final class Bootstrap 37 { 38 39 42 private Bootstrap() 43 { 44 45 } 46 47 53 public static void main(final String [] args) throws Exception 54 { 55 System.setSecurityManager(new SecurityManager ()); 57 58 NamingService ns; 59 String canonicalHostName = InetAddress.getLocalHost().getHostName(); 60 if (args.length == 0 || canonicalHostName.equals(args[0])) 61 { 62 Registry.createRegistry(Registry.DEFAULT_PORT); 63 ns = Registry.getRegistry(); 64 } 65 else 66 { 67 ns = Registry.getRegistry(args[0]); 68 } 69 70 ns.bind(canonicalHostName, Fractal.getBootstrapComponent()); 71 System.err.println("Server registered under " + canonicalHostName); 72 } 73 74 } | Popular Tags |