test/java/rmi/server/Unreferenced/leaseCheckInterval/SelfTerminator.java

Print this page

        

*** 31,42 **** public class SelfTerminator { public static void main(String[] args) { try { Registry registry = ! LocateRegistry.getRegistry("", TestLibrary.REGISTRY_PORT); Remote stub = registry.lookup(LeaseCheckInterval.BINDING); Runtime.getRuntime().halt(0); } catch (Exception e) { e.printStackTrace(); } --- 31,44 ---- public class SelfTerminator { public static void main(String[] args) { try { + int registryPort = + new Integer(System.getProperty("rmi.registry.port")); Registry registry = ! LocateRegistry.getRegistry("", registryPort); Remote stub = registry.lookup(LeaseCheckInterval.BINDING); Runtime.getRuntime().halt(0); } catch (Exception e) { e.printStackTrace(); }