mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8345045: Remove the jmx.remote.x.buffer.size JMX notification property
Reviewed-by: amenkov, sspitsyn
This commit is contained in:
parent
119899bc69
commit
8b46db0c0d
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, 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
|
||||
@ -262,21 +262,11 @@ public class EnvHelp {
|
||||
public static int getNotifBufferSize(Map<String, ?> env) {
|
||||
int defaultQueueSize = 1000; // default value
|
||||
|
||||
// keep it for the compatibility for the fix:
|
||||
// 6174229: Environment parameter should be notification.buffer.size
|
||||
// instead of buffer.size
|
||||
final String oldP = "jmx.remote.x.buffer.size";
|
||||
|
||||
// the default value re-specified in the system
|
||||
try {
|
||||
String s = System.getProperty(BUFFER_SIZE_PROPERTY);
|
||||
if (s != null) {
|
||||
defaultQueueSize = Integer.parseInt(s);
|
||||
} else { // try the old one
|
||||
s = System.getProperty(oldP);
|
||||
if (s != null) {
|
||||
defaultQueueSize = Integer.parseInt(s);
|
||||
}
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
logger.warning("getNotifBufferSize",
|
||||
@ -292,10 +282,6 @@ public class EnvHelp {
|
||||
queueSize = (int)EnvHelp.getIntegerAttribute(env,BUFFER_SIZE_PROPERTY,
|
||||
defaultQueueSize,0,
|
||||
Integer.MAX_VALUE);
|
||||
} else { // try the old one
|
||||
queueSize = (int)EnvHelp.getIntegerAttribute(env,oldP,
|
||||
defaultQueueSize,0,
|
||||
Integer.MAX_VALUE);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
logger.warning("getNotifBufferSize",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 2025, 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
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test NotifBufferSizePropertyNameTest
|
||||
* @bug 6174229
|
||||
* @bug 6174229 8345045
|
||||
* @summary Verify the property name specifying server notification buffer size.
|
||||
* @author Shanliang JIANG
|
||||
*
|
||||
@ -52,35 +52,25 @@ public class NotifBufferSizePropertyNameTest {
|
||||
};
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println(
|
||||
"Verify the property name specifying the server notification buffer size.");
|
||||
System.out.println("Verify the property name specifying the server notification buffer size.");
|
||||
|
||||
oname = new ObjectName ("Default:name=NotificationEmitter");
|
||||
url = new JMXServiceURL("rmi", null, 0);
|
||||
Map env = new HashMap(2);
|
||||
|
||||
System.out.println("Test the new property name.");
|
||||
System.out.println("Test the property name.");
|
||||
env.put("jmx.remote.x.notification.buffer.size", String.valueOf(bufferSize));
|
||||
test(env);
|
||||
|
||||
System.out.println("Test the old property name.");
|
||||
env.remove("jmx.remote.x.notification.buffer.size");
|
||||
env.put("jmx.remote.x.buffer.size", String.valueOf(bufferSize));
|
||||
test(env);
|
||||
|
||||
// Recognition of the old, incorrect property "jmx.remote.x.buffer.size" has been dropped.
|
||||
// Do not test old name is recognised, but do test it does not interfere with correct name:
|
||||
System.out.println("Test that the new property name overwrite the old one.");
|
||||
env.put("jmx.remote.x.notification.buffer.size", String.valueOf(bufferSize));
|
||||
env.put("jmx.remote.x.buffer.size", String.valueOf(bufferSize*6));
|
||||
test(env);
|
||||
|
||||
System.out.println("Test the old property name on system.");
|
||||
System.setProperty("jmx.remote.x.buffer.size", String.valueOf(bufferSize));
|
||||
test(null);
|
||||
|
||||
System.out.println(
|
||||
"Test that the new property name overwrite the old one on system.");
|
||||
System.setProperty("jmx.remote.x.notification.buffer.size",
|
||||
String.valueOf(bufferSize));
|
||||
System.out.println("Test that the new property name overwrite the old one on system.");
|
||||
System.setProperty("jmx.remote.x.notification.buffer.size", String.valueOf(bufferSize));
|
||||
System.setProperty("jmx.remote.x.buffer.size", String.valueOf(bufferSize*6));
|
||||
test(null);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user