|
22 | 22 | import java.util.ArrayList; |
23 | 23 | import java.util.Arrays; |
24 | 24 | import java.util.Collection; |
25 | | -import java.util.HashMap; |
26 | 25 | import java.util.List; |
27 | | -import java.util.Map; |
28 | 26 | import java.util.concurrent.BlockingQueue; |
29 | 27 | import java.util.concurrent.ExecutionException; |
30 | 28 | import java.util.concurrent.LinkedBlockingDeque; |
@@ -200,25 +198,13 @@ public void export( |
200 | 198 | } |
201 | 199 |
|
202 | 200 | protected static String genericJmxJvmArguments(int port) { |
203 | | - Map<String, Object> args = new HashMap<>(); |
204 | | - args.put("com.sun.management.jmxremote.local.only", "false"); |
205 | | - args.put("com.sun.management.jmxremote.authenticate", "false"); |
206 | | - args.put("com.sun.management.jmxremote.ssl", "false"); |
207 | | - args.put("com.sun.management.jmxremote.port", port); |
208 | | - args.put("com.sun.management.jmxremote.rmi.port", port); |
209 | | - List<String> list = |
210 | | - args.entrySet().stream() |
211 | | - .map((e) -> toJvmArg(e.getKey(), e.getValue())) |
212 | | - .collect(Collectors.toList()); |
213 | | - return String.join(" ", list); |
| 201 | + return "-Dcom.sun.management.jmxremote.local.only=false" |
| 202 | + + " -Dcom.sun.management.jmxremote.authenticate=false" |
| 203 | + + " -Dcom.sun.management.jmxremote.ssl=false" |
| 204 | + + " -Dcom.sun.management.jmxremote.port=" |
| 205 | + + port |
| 206 | + + " -Dcom.sun.management.jmxremote.rmi.port=" |
| 207 | + + port; |
214 | 208 | } |
215 | 209 |
|
216 | | - private static String toJvmArg(String key, Object value) { |
217 | | - StringBuilder sb = new StringBuilder(); |
218 | | - sb.append("-D").append(key); |
219 | | - if (value != null) { |
220 | | - sb.append("=").append(value); |
221 | | - } |
222 | | - return sb.toString(); |
223 | | - } |
224 | 210 | } |
0 commit comments