test/java/rmi/testlibrary/RegistryRunner.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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.

@@ -54,16 +54,17 @@
 
     /**
      * Request that the registry process exit and handle
      * related exceptions.
      */
-    public static void requestExit() {
+    public static void requestExit(int port) {
+
         try {
             RemoteExiter exiter =
                 (RemoteExiter)
                 Naming.lookup("rmi://localhost:" +
-                              TestLibrary.REGISTRY_PORT +
+                              port +
                               "/RemoteExiter");
             try {
                 exiter.exit();
             } catch (RemoteException re) {
             }

@@ -82,11 +83,11 @@
         try {
             if (args.length == 0) {
                 System.err.println("Usage: <port>");
                 System.exit(0);
             }
-            int port = TestLibrary.REGISTRY_PORT;
+            int port = -1;
             try {
                 port = Integer.parseInt(args[0]);
             } catch (NumberFormatException nfe) {
             }