The JavaTMManagement Extensions (JMX) API
The JMX API is a standard API for management and monitoring of resources such as applications, devices, services, and the Java virtual machine.
Typical uses of the JMX technology include:
- Consulting and changing application configuration.
- Accumulating and publishing statistics about application behavior.
- Notifying users or applications of state changes and erroneous conditions.
The JMX API includes remote access, so a remote management program can interact with a running application for the above purposes.
The JMX technology is developed through the Java Community Process (JCP). In JDK versions 5.0 and 6, the JMX technology was developed as Java Specification Request (JSR) 3, Java Management Extensions, and JSR 160, JMX Remote API. Evolutions of the JMX API and JMX Remote API in JDK version 7 are covered by JSR 255, JMX API 2.0.
JMX Implementation Sources
The JMX implementation is composed of the following packages :
- javax.management and sub-packages: The public JMX API packages. The evolution of these APIs is governed by the JMX Specifications.
- com.sun.jmx and sub-packages: The private Sun implementation packages. These packages constitute a private API which is subject to changes. Only JDK software library classes should call these APIs.
Contributing to the JMX API
To contribute to the JMX API, make sure you read the page explaining how to contribute to OpenJDK, and follow the rules and guidelines described there. You will find out that there can be many ways to contribute: one of them is to contribute to the quality.
The JMX API is a pure Java class library. It does not contain any native code. We are providing a JMX NetBeans Integrated Development Environment (IDE) project that will help you to work easily with the JMX API code. This project will let you work on the JMX APIs without having to build the whole OpenJDK from scratch.
If you wish to work on the JMX technology using the NetBeans IDE project provided with OpenJDK, you will need to download and install the following prerequisites:
Note that early builds of NetBeans IDE 6 (such as NetBeans IDE version 6 milestone 7) will not work with the provided project. You will need one of the latest builds.
To build and test the JMX API refer to the README file associated with the JMX technology NetBeans project, located in the OpenJDK source tree under j2se/make/netbeans/jmx/.
It is also possible to build and test the JMX APIs without the
IDE, using the
build.xml file provided in the
j2se/make/netbeans/jmx/ directory. However, you will need
to download and install Apache
Ant version 1.6.5 or above, as well as the latest OpenJDK (or
JDK version 7) binary bits and the
jtreg test harness
- Go to the j2se/make/netbeans/jmx/ directory.
- Make sure you read the README first - you might need to configure a few variables.
- To build, run the command '
- To test, run the command '
You might be also interested in contributing to JConsole. The jconsole tool is a JMX-compliant graphical tool for monitoring a Java virtual machine.
Debugging and Troubleshooting Tips
The JMX technology uses the java.util.logging API to print debug traces. You can activate these traces by providing a logging.properties file on the command line when you run your Java application.
This post contains information about various methods to activate traces in the JMX technology. You will also find information about troubleshooting connections and security problems in this other post. Finally the JDK version 6 Troubleshooting Java SE guide has also general useful information.
- The specialized JMX Trail from the online Java Tutorials.
- The JMX Technology's Home Page - The page for news, downloads, blogs and other information about the JMX specification.
- The JDK version 6 JMX Technology Guides - The page for tutorials, API documentation, and links.
Among many others, here are also a few articles to get you started on learning about the JMX technology:
- What is JMX? - a short introduction to the JMX technology.
- Java theory and practice: Instrumenting applications with JMX.
- Authentication and Authorization in JMX RMI connectors - an in depth description of authentication and authorization mechanisms using the JMX technology's Remote Method Invocation (RMI) Connector.
See also the advanced JMX technology example in JDK_HOME/samples/jmx/jmx-scandir, where JDK_HOME is the directory in which the JDK software is installed.
- Mailing lists
- JMX bloggers
- Éamonn McManus: JMX Specification Lead: The web log of the JMX Specification lead.
- Jean-François Denise: JMX, NetBeans and More!: News and tips relating to the JMX NetBeans module.
- Daniel Fuchs: JMX, SNMP, Java, etc...: Various musings about the JMX API, network technology, the Java platform and related subjects.
- Luis-Miguel Alventosa: JMX, RMI, Monitoring & Security: Tech tips and updates about the security and monitoring aspects of the JMX technology.
- Joël Féraud: Building JMX source code: How to modify, recompile and rebuild the source code of the JMX API.