Java Management Extensions
| Company type | Technology / API |
|---|---|
| Industry | Software, Java platform |
Area served | Worldwide |
| Products | Java Management Extensions API, JMX Remote API, JMX connectors and protocol adapters |
| Owner | Oracle Corporation |
| Parent | Java Community Process |
| Website | www |
Java Management Extensions (JMX) is a Java technology designed to facilitate the management and monitoring of applications, system components, devices such as printers, and service-oriented network infrastructures. These elements are modeled as objects known as MBeans (Managed Beans). The API supports dynamic class loading and object creation. Developers can build application management solutions using the Java Dynamic Management Kit.
JMX versions 1.0, 1.1, and 1.2 were standardized through JSR 003 within the Java Community Process. Although JSR 255 aimed to introduce JMX 2.0, it was eventually discontinued. Remote management capabilities via the JMX Remote API 1.0 are defined by JSR 160. Additionally, an extension focused on Web Services integration was under development through JSR 262.
The J2EE community quickly embraced JMX, and it has been included in J2SE starting from version 5.0. The term "JMX" is a registered trademark of Oracle Corporation.
Architecture
JMX is structured around a three-tier architecture:
- The Instrumentation or Probe tier consists of probes called MBeans that instrument resources.
- The Agent tier includes the MBeanServer, which functions as a mediator between MBeans and client applications.
- The Remote Management tier facilitates external access to the MBeanServer through connectors and adapters. Connectors provide comprehensive remote communication using protocols such as RMI, IIOP, JMS, or WS-*, whereas adapters convert the API to other protocols like SNMP or web-based interfaces (e.g., HTML/HTTP, WML/HTTP).
Management tools vary from general-purpose consoles like JConsole and MC4J to specialized monitoring solutions tailored to specific domains. External systems connect to MBeans via JMX connectors and protocol adapters. Connectors establish links between agents and remote management clients; the default connector included with the Java Platform, Standard Edition is the RMI connector, which utilizes Java's Remote Method Invocation mechanism and is widely employed by management utilities.
Protocol adapters present management data through particular protocols but typically require dedicated client software.
Managed beans
A managed bean (MBean) is a form of JavaBean developed using dependency injection. MBeans serve as fundamental components within Java Management Extensions (JMX), with Java EE 6 further specifying managed beans under defined criteria.
An MBean symbolizes a resource executing within the Java virtual machine, such as an application or Java EE service like a transactional monitor or JDBC driver. They facilitate gathering performance metrics and resource consumption data (pull), managing configurations (push/pull), and emitting notifications for events such as errors or status updates (push).
In Java EE 6 terminology, a managed bean refers to a Java class identified as its bean class. A top-level class qualifies as a managed bean if it satisfies these requirements:
- It is not an inner class unless static.
- It is either a concrete class or marked with
@Decorator. - It does not carry annotations that define EJB components and is not declared as an EJB bean in
ejb-jar.xml.
No specific annotation is necessary to designate a managed bean.
To inform the MBeanServer about internal changes in attributes, MBeans can implement javax.management.NotificationEmitter. Applications interested in these events register listeners (javax.management.NotificationListener) to receive notifications; however, JMX does not ensure delivery of every notification.
Categories
There are two main categories of MBeans:
- Standard MBeans feature a business interface providing attribute accessors and mutators alongside operation methods.
- Dynamic MBeans implement the
javax.management.DynamicMBeaninterface, enabling runtime discovery and management of attributes and operations.
Other varieties include Open MBeans, which utilize simple data types to facilitate easier user interaction; Model MBeans, which offer configurability during execution; and generic MBeans designed for dynamic resource configuration on the fly.
A specialized form, the MXBean (also called a Platform MBean), represents specific JVM components such as garbage collection, JIT compilation, memory pools, and multi-threading.
The MLet (Management applet) serves as a utility MBean responsible for loading, creating instances of, and registering MBeans within an MBeanServer using an XML descriptor structured as follows:
<MLET CODE = ''class'' | OBJECT = ''serfile'' ARCHIVE = ''archiveList'' [CODEBASE = ''codebaseURL''] [NAME = ''objectName''] [VERSION = ''version''] > [arglist] </MLET>
Vendor and Platform Support
JMX technology is embraced by numerous vendors and platforms, including:
- Java application servers such as OpenCloud Rhino, JBoss, JOnAS, WebSphere Application Server, WebLogic, SAP NetWeaver Application Server, Oracle Application Server 10g, and Sun Java System Application Server.
- Directory services including UnboundID Directory Server, Proxy Server, and Synchronization Server.
- Systems management solutions like Empirix OneSight, GroundWork Monitor, Hyperic, HP OpenView, IBM Director, ITRS Geneos, Nimsoft NMS, OpenNMS, Zabbix, Zenoss Core, Zyrion, SolarWinds, Uptime Infrastructure Monitor, and LogicMonitor.
- Java servlet containers including Apache Tomcat and Jetty (web server).
- Open source initiatives such as MX4J—an enterprise-grade JMX implementation—jManage (a professional JMX console), MC4J (a graphical console), and snmpAdaptor4j which provides SNMP access to MBeans.
- Lightweight command-line utilities like jvmtop for JVM monitoring.
- Monitoring platforms including Prometheus through its JMX exporter plugin, as well as New Relic’s infrastructure agent that integrates JMX metrics into its observability dashboards.
- Jolokia, a Java agent that exposes JMX over HTTP, facilitating access from non-Java environments.
Related Topics
References
Articles
- "Enabling Component Architectures with JMX" by Marc Fleury and Juha Lindfors
- "Introducing A New Vendor-Neutral J2EE Management API" by Andreas Schaefer
- "Java in the management sphere" by Max Goff 1999
- JMX/JBoss – The microkernel architecture
- "Manage your JMX-enabled applications with jManage 1.0" by Rakesh Kalra Jan 16, 2006
- "Managing J2EE Systems with JMX and JUnit" by Lucas McGregor
- Sun Java Overview of Monitoring and Management
- The Java EE 6 Tutorial: About managed beans
Recommended Reading
- Benjamin G Sullins, Mark B Whipple: JMX in Action: Launching Your Initial JMX Application, Manning Publications Co., 2002
- J. Steven Perry: Java Management Extensions, O'Reilly Media
- Jeff Hanson: Connecting JMX Clients and Servers: A Comprehensive Guide to Java Management Extensions, APress L. P.
- Marc Fleury, Juha Lindfors: JMX: Administering J2EE Using Java Management Extensions, Sams Publishing
Additional Resources
- JMX 1.4 Specification (Included in Java SE 6)
- JMX Documentation at JBoss.com
- Official JMX Information on Oracle.com
- JSR 255 (Defines JMX 2.0)
- JSR 3 (Covers JMX versions 1.0, 1.1, and 1.2)