test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/HelloImpl.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1998, 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) 1998, 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.
*** 63,74 **** try { String protocol = ""; if (args.length >= 1) protocol = args[0]; registry = java.rmi.registry.LocateRegistry. ! getRegistry("localhost", TestLibrary.REGISTRY_PORT, new Compress.CompressRMIClientSocketFactory()); UseCustomSocketFactory.checkStub(registry, "RMIClientSocket"); hello = (Hello) registry.lookup("/HelloServer"); /* lookup server */ --- 63,75 ---- try { String protocol = ""; if (args.length >= 1) protocol = args[0]; + int registryPort = Integer.parseInt(System.getProperty("rmi.registry.port")); registry = java.rmi.registry.LocateRegistry. ! getRegistry("localhost", registryPort, new Compress.CompressRMIClientSocketFactory()); UseCustomSocketFactory.checkStub(registry, "RMIClientSocket"); hello = (Hello) registry.lookup("/HelloServer"); /* lookup server */