changeset 22091:9e1731e5cfc7

8007256: RMI testlibrary cleanup: remove JavaVMCallbackHandler Reviewed-by: darcy
author smarks
date Tue, 24 Dec 2013 16:43:19 -0800
parents 658d6e464dd5
children 0fdcb913f6be
files jdk/test/java/rmi/testlibrary/JavaVM.java
diffstat 1 files changed, 1 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/test/java/rmi/testlibrary/JavaVM.java	Tue Dec 24 08:42:21 2013 -0500
+++ b/jdk/test/java/rmi/testlibrary/JavaVM.java	Tue Dec 24 16:43:19 2013 -0800
@@ -59,9 +59,6 @@
         }
     }
 
-    public JavaVM(String classname) {
-        this.classname = classname;
-    }
     public JavaVM(String classname,
                   String options, String args) {
         this.classname = classname;
@@ -110,15 +107,6 @@
         return TestLibrary.getExtraProperty("jcov.options","");
     }
 
-    public void start(Runnable runnable) throws IOException {
-        if (runnable == null) {
-            throw new NullPointerException("Runnable cannot be null.");
-        }
-
-        start();
-        new JavaVMCallbackHandler(runnable).start();
-    }
-
     /**
      * Exec the VM as specified in this object's constructor.
      */
@@ -176,7 +164,7 @@
      */
     public int waitFor() throws InterruptedException {
         if (vm == null)
-            throw new IllegalStateException("can't wait for JavaVM that hasn't started");
+            throw new IllegalStateException("can't wait for JavaVM that isn't running");
 
         int status = vm.waitFor();
         outPipe.join();
@@ -191,35 +179,4 @@
         start();
         return waitFor();
     }
-
-    /**
-     * Handles calling the callback.
-     */
-    private class JavaVMCallbackHandler extends Thread {
-        Runnable runnable;
-
-        JavaVMCallbackHandler(Runnable runnable) {
-            this.runnable = runnable;
-        }
-
-
-        /**
-         * Wait for the Process to terminate and notify the callback.
-         */
-        @Override
-        public void run() {
-            if (vm != null) {
-                try {
-                    vm.waitFor();
-                } catch(InterruptedException ie) {
-                    // Restore the interrupted status
-                    Thread.currentThread().interrupt();
-                }
-            }
-
-            if (runnable != null) {
-                runnable.run();
-            }
-        }
-    }
 }