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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 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 = + Integer.parseInt(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(); }