- Where can you find out all those Platform MBean Object Names ?
- How would you connect via JMX with username and password programmatically ?
Some possible answers:
- Where can you find out all those Platform MBean Object Names ?
java.lang.management.ManagementFactory
- How would you connect via JMX with username and password programmatically ?
Map<String,String[]> env = new HashMap<String,String[]>();
env.put(JMXConnector.CREDENTIALS, new String[]{"username", "password"});
final String url = "service:jmx:rmi://" + host + "/jndi/rmi://" + host + ":" + port + "/jmxrmi";
JMXServiceURL jmxServiceUrl = new JMXServiceURL(url);
JMXConnector conn = JMXConnectorFactory.connect(jmxServiceUrl, env);
MBeanServerConnection mbsc = conn.getMBeanServerConnection();
...
# posted by rot13(Unafba Pune) @ 3:43 PM