< prev index next >

test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java

Print this page




  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /* @test
  25  * @bug 4308492
  26  * @summary In addition to keeping the VM alive (with a non-daeman thread)
  27  * while there are remote objects exported, the RMI runtime should also
  28  * keep it alive while there remain calls in progress (to remote objects
  29  * the have presumably been unexported), so that a remote object can more
  30  * conveniently implement a graceful remote shutdown method (that unexports
  31  * the object).
  32  * @author Peter Jones
  33  *
  34  * @library ../../../testlibrary




  35  * @build TestLibrary JavaVM KeepAliveDuringCall_Stub
  36  *     ShutdownMonitor Shutdown ShutdownImpl ShutdownImpl_Stub
  37  * @run main/othervm KeepAliveDuringCall
  38  */
  39 
  40 import java.rmi.Remote;
  41 import java.rmi.RemoteException;
  42 import java.rmi.registry.LocateRegistry;
  43 import java.rmi.registry.Registry;
  44 import java.rmi.server.UnicastRemoteObject;
  45 
  46 public class KeepAliveDuringCall implements ShutdownMonitor {
  47 
  48     public static final String BINDING = "KeepAliveDuringCall";
  49     private static final int TIMEOUT = 20000;
  50 
  51     private Object lock = new Object();
  52     private Shutdown shutdown = null;
  53     private boolean stillAlive = false;
  54 




  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /* @test
  25  * @bug 4308492
  26  * @summary In addition to keeping the VM alive (with a non-daeman thread)
  27  * while there are remote objects exported, the RMI runtime should also
  28  * keep it alive while there remain calls in progress (to remote objects
  29  * the have presumably been unexported), so that a remote object can more
  30  * conveniently implement a graceful remote shutdown method (that unexports
  31  * the object).
  32  * @author Peter Jones
  33  *
  34  * @library ../../../testlibrary
  35  * @modules java.rmi/sun.rmi.registry
  36  *          java.rmi/sun.rmi.server
  37  *          java.rmi/sun.rmi.transport
  38  *          java.rmi/sun.rmi.transport.tcp
  39  * @build TestLibrary JavaVM KeepAliveDuringCall_Stub
  40  *     ShutdownMonitor Shutdown ShutdownImpl ShutdownImpl_Stub
  41  * @run main/othervm KeepAliveDuringCall
  42  */
  43 
  44 import java.rmi.Remote;
  45 import java.rmi.RemoteException;
  46 import java.rmi.registry.LocateRegistry;
  47 import java.rmi.registry.Registry;
  48 import java.rmi.server.UnicastRemoteObject;
  49 
  50 public class KeepAliveDuringCall implements ShutdownMonitor {
  51 
  52     public static final String BINDING = "KeepAliveDuringCall";
  53     private static final int TIMEOUT = 20000;
  54 
  55     private Object lock = new Object();
  56     private Shutdown shutdown = null;
  57     private boolean stillAlive = false;
  58 


< prev index next >