How to access local adapter
Hi,
I'm running a JMX application using local adapter (-Dcom.sun.management.jmxremote placed on the command line). Is there any way to connect to the application programmatically, like jconsole does? It seems there is no information on issue in tutorial. If this is not possible and I need to start "remote" adaptor like described in JMX Connectors tutorial section could you let me know this fact?
Thanks,
Roman
Hi Roman,
J2SE 5.0 doesn't provide a public programmatic interface to connect to the out-of-the-box management agent for local management. JConsole in J2SE 5.0 accesses the local connector server through a private interface. So in your case you will have to start your application with the com.sun.management.jmxremote.port=xxx option and connect to it as if you were remotely accessing it.
However, JDK 6 adds support for dynamically enabling any given running Java application for monitoring and management and connecting to it through the new Attach API.
For more detailed info have a look at the following link:
http://download.java.net/jdk6/docs/technotes/guides/management/agent.html
Regards,
Luis-Miguel ALVENTOSA
JMX Java SE development team
Sun Microsystems, Inc.