For an application to be monitored using JMX the JMX Server should be running- com.sun.jmx.mbeanserver.JmxMBeanServer
For an JVM instance to support JMX following needs to be passed to the VM
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
Implemented using Java RMI
Java 6 allows for jconsole to attach itself to a running process even after it has been started without JMX incantations.
To access the MBeanServer in the same JVM -
ManagementFactory.getPlatformMBeanServer();
is the way to do it.JMXConnectorFactory
is for accessing remote MBeanServers (i.e. in a different JVM, and/or on a different host).For an JVM instance to support JMX following needs to be passed to the VM
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
Implemented using Java RMI
Java 6 allows for jconsole to attach itself to a running process even after it has been started without JMX incantations.
No comments:
Post a Comment