jdk/test/java/rmi/activation/Activatable/shutdownGracefully/ShutdownGracefully.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
166 } |
166 } |
167 |
167 |
168 registering = null; |
168 registering = null; |
169 |
169 |
170 // Need to make sure that rmid goes away by itself |
170 // Need to make sure that rmid goes away by itself |
171 Process rmidProcess = rmid.getVM(); |
171 JavaVM rmidProcess = rmid; |
172 if (rmidProcess != null) { |
172 if (rmidProcess != null) { |
173 try { |
173 try { |
174 Runnable waitThread = |
174 Runnable waitThread = |
175 new ShutdownDetectThread(rmidProcess); |
175 new ShutdownDetectThread(rmidProcess); |
176 |
176 |
203 |
203 |
204 /** |
204 /** |
205 * class that waits for rmid to exit |
205 * class that waits for rmid to exit |
206 */ |
206 */ |
207 private static class ShutdownDetectThread implements Runnable { |
207 private static class ShutdownDetectThread implements Runnable { |
208 private Process rmidProcess = null; |
208 private JavaVM rmidProcess = null; |
209 |
209 |
210 ShutdownDetectThread(Process rmidProcess) { |
210 ShutdownDetectThread(JavaVM rmidProcess) { |
211 this.rmidProcess = rmidProcess; |
211 this.rmidProcess = rmidProcess; |
212 } |
212 } |
213 public void run() { |
213 public void run() { |
214 System.err.println("waiting for rmid to shutdown"); |
214 System.err.println("waiting for rmid to shutdown"); |
215 |
215 |