Java Management Extensions
Java Management Extensions is a Java technology that supplies tools for managing and monitoring applications, system objects, devices and service-oriented networks. Those resources are represented by objects called MBeans. In the API, classes can be dynamically loaded and instantiated.
Managing and monitoring applications can be designed and developed using the Java Dynamic Management Kit.
JSR 003 of the Java Community Process defined JMX 1.0, 1.1 and 1.2. JMX 2.0 was being developed under JSR 255, but this JSR was subsequently withdrawn. The JMX Remote API 1.0 for remote management and monitoring is specified by JSR 160. An extension of the JMX Remote API for Web Services was being developed under JSR 262.
Adopted early on by the J2EE community, JMX has been a part of J2SE since version 5.0. "JMX" is a trademark of Oracle Corporation.
Architecture
JMX uses a three-level architecture:- The Probe level – also called the Instrumentation level – contains the probes instrumenting the resources
- The Agent level, or MBeanServer – the core of JMX. It acts as an intermediary between the MBean and the applications.
- The Remote Management level enables remote applications to access the MBeanServer through connectors and adaptors. A connector provides full remote access to the MBeanServer API using various communication, while an adaptor adapts the API to another protocol or to Web-based GUI.
The Java Platform, Standard Edition ships with one connector, the RMI connector, which uses the Java Remote Method Protocol that is part of the Java remote method invocation API. This is the connector which most management applications use.
Protocol adapters provide a management view of the JMX agent through a given protocol. Management applications that connect to a protocol adapter are usually specific to the given protocol.
Managed beans
A managed bean – sometimes simply referred to as an MBean – is a type of JavaBean, created with dependency injection. Managed Beans are particularly used in the Java Management Extensions technology – but with Java EE 6 the specification provides for a more detailed meaning of a managed bean.The MBean represents a resource running in the Java virtual machine, such as an application or a Java EE technical service. They can be used for collecting statistics on concerns like performance, resources usage, or problems ; for getting and setting application configurations or properties ; and notifying events like faults or state changes.
Java EE 6 provides that a managed bean is a bean that is implemented by a Java class, which is called its bean class. A top-level Java class is a managed bean if it is defined to be a managed bean by any other Java EE technology specification, or if it meets all of the following conditions:
- It is not a non-static inner class.
- It is a concrete class, or is annotated
@Decorator. - It is not annotated with an EJB component-defining annotation or declared as an EJB bean class in
ejb-jar.xml.
A MBean can notify the MBeanServer of its internal changes by implementing the
javax.management.NotificationEmitter. The application interested in the MBean's changes registers a listener to the MBeanServer. Note that JMX does not guarantee that the listeners will receive all notifications.Types
There are two basic types of MBean:- Standard MBeans implement a business interface containing setters and getters for the attributes and the operations.
- Dynamic MBeans implement the
javax.management.DynamicMBeaninterface that provides a way to list the attributes and operations, and to get and set the attribute values.
A MXBean is a special type of MBean that reifies Java virtual machine subsystems such as garbage collection, JIT compilation, memory pools, multi-threading, etc.
A MLet is a utility MBean to load, instantiate and register MBeans in a MBeanServer from an XML description. The format of the XML descriptor is:
class | OBJECT = serfile
ARCHIVE = archiveList
>
Support
JMX is supported at various levels by different vendors:- JMX is supported by Java application servers such as OpenCloud Rhino Application Server , JBoss, JOnAS, WebSphere Application Server, WebLogic, SAP NetWeaver Application Server, Oracle Application Server 10g and Sun Java System Application Server.
- JMX is supported by the UnboundID Directory Server, Directory Proxy Server, and Synchronization Server.
- Systems management tools that support the protocol include Empirix OneSight, GroundWork Monitor, Hyperic, HP OpenView, IBM Director, ITRS Geneos, Nimsoft NMS, OpenNMS, Zabbix, Zenoss Core, and Zyrion, SolarWinds, , and LogicMonitor.
- JMX is also supported by servlet containers such as Apache Tomcat. & Jetty
- MX4J is Open Source JMX for Enterprise Computing.
- jManage is an open source enterprise-grade JMX Console with Web and command-line interfaces.
- MC4J is an open source visual console for connecting to servers supporting JMX
- snmpAdaptor4j is an open source providing a simple access to MBeans via the SNMP protocol.
- is a lightweight open source JMX monitoring tool for the command-line
- Prometheus can ingest JMX data via the JMX exporter which exposes metrics in Prometheus format.
- New Relic's on-host infrastructure agent collects JMX data which is shown in various charts in its observability platform's dashboard.
- is a Java agent that exposes JMX over HTTP for easy access from non-Java systems.
Articles
- "" by Marc Fleury and Juha Lindfors
- "" by Andreas Schaefer
- "Java in the management sphere" by Max Goff 1999
- #
- #
- #
- – The microkernel design
- "" by Rakesh Kalra Jan 16, 2006
- " " by Lucas McGregor
-
Books
- Benjamin G Sullins, Mark B Whipple : JMX in Action: You will also get your first JMX application up and running, Manning Publications Co. 2002,
- J. Steven Perry: Java Management Extensions, O'Reilly,
- Jeff Hanson: Connecting JMX Clients and Servers: Understanding the Java Management Extensions, APress L. P.,
- Marc Fleury, Juha Lindfors: JMX: Managing J2EE with Java Management Extensions, Sams Publishing,