/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5039210
* @summary test on a client notification deadlock.
* @author Shanliang JIANG
* @run clean DeadLockTest
* @run build DeadLockTest
* @run main DeadLockTest
*/
import javax.management.*;
public class DeadLockTest {
boolean ok = true;
try {
} catch (Exception e) {
}
}
}
throws Exception {
JMXServiceURL u = null;
// server will close a client connection after 1 second
// disable the client ping
try {
} catch (MalformedURLException e) {
}
long st = 2000;
// a cycle to make sure that we test the blocking problem.
do {
// wait the server to close the client connection
// makes the listener to do a remote request via the connection
// which should be closed by the server.
// allow the listner to have time to work
// get a closed notif, should no block.
st += 2000;
} while(!myListener.isDone());
}
}
if (n instanceof JMXConnectionNotification) {
synchronized(this) {
done = false;
}
try {
} catch (IOException ioe) {
// Greate !
}
synchronized(this) {
done = true;
}
}
}
}
public boolean isDone() {
synchronized(this) {
return done;
}
}
private boolean done = false;
}
}