private void connect() throws IOException {
System.out.println(
"JMXConnectorThread: Attempting JMX connection on: "
+ addr + " on port " + jmxPort);
JMXServiceURL url;
try {
url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"
+ addr + ":" + jmxPort + "/jmxrmi");
} catch (MalformedURLException e) {
throw new RuntimeException("Test failed.", e);
}
Map<String, Object> env = new HashMap<>();
if (useSSL) {
SslRMIClientSocketFactory csf = new SslRMIClientSocketFactory();
env.put("com.sun.jndi.rmi.factory.socket", csf);
env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
}
// connect and immediately close
JMXConnector c = JMXConnectorFactory.connect(url, env);
c.close();
System.out.println("JMXConnectorThread: connection to JMX worked");
jmxConnectWorked = true;
checkRmiSocket();
latch.countDown(); // signal we are done.
}
JMXAgentInterfaceBinding.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:jdk8u_jdk
作者:
评论列表
文章目录