test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/EchoImpl.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.
*** 62,73 ****
if (args.length >= 1)
protocol = args[0];
System.out.println("EchoServer: creating remote object");
EchoImpl impl = new EchoImpl(protocol);
System.out.println("EchoServer: binding in registry");
! Naming.rebind("//:" + TestLibrary.REGISTRY_PORT +
"/EchoServer", impl);
System.out.println("EchoServer ready.");
} catch (Exception e) {
System.err.println("EXCEPTION OCCURRED:");
e.printStackTrace();
--- 62,74 ----
if (args.length >= 1)
protocol = args[0];
System.out.println("EchoServer: creating remote object");
EchoImpl impl = new EchoImpl(protocol);
+ int registryPort = Integer.parseInt(System.getProperty("rmi.registry.port"));
System.out.println("EchoServer: binding in registry");
! Naming.rebind("//:" + registryPort +
"/EchoServer", impl);
System.out.println("EchoServer ready.");
} catch (Exception e) {
System.err.println("EXCEPTION OCCURRED:");
e.printStackTrace();