test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2001, 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) 2001, 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.
*** 85,104 ****
try {
UnicastRemoteObject.exportObject(obj);
System.err.println("exported remote object");
Registry localRegistry =
! LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
System.err.println("created local registry");
localRegistry.bind(BINDING, obj);
System.err.println("bound remote object in local registry");
synchronized (obj.lock) {
System.err.println("starting remote client VM...");
! (new JavaVM("SelfTerminator")).start();
System.err.println("waiting for unreferenced() callback...");
obj.lock.wait(TIMEOUT);
if (obj.unreferencedInvoked) {
--- 85,106 ----
try {
UnicastRemoteObject.exportObject(obj);
System.err.println("exported remote object");
+ int registryPort = TestLibrary.getUnusedRandomPort();
Registry localRegistry =
! LocateRegistry.createRegistry(registryPort);
System.err.println("created local registry");
localRegistry.bind(BINDING, obj);
System.err.println("bound remote object in local registry");
synchronized (obj.lock) {
System.err.println("starting remote client VM...");
! (new JavaVM("SelfTerminator", "-Drmi.registry.port=" +
! registryPort, "")).start();
System.err.println("waiting for unreferenced() callback...");
obj.lock.wait(TIMEOUT);
if (obj.unreferencedInvoked) {