Jump to content

Java Management Extensions

From Alfawiki
Java Management Extensions (JMX)
Company typeTechnology / API
IndustrySoftware, Java platform
Area served
Worldwide
ProductsJava Management Extensions API, JMX Remote API, JMX connectors and protocol adapters
OwnerOracle Corporation
ParentJava Community Process
Websitewww.oracle.com/java/technologies/javase/jmx.html

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:

  1. The Instrumentation or Probe tier consists of probes called MBeans that instrument resources.
  2. The Agent tier includes the MBeanServer, which functions as a mediator between MBeans and client applications.
  3. 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:

  1. It is not an inner class unless static.
  2. It is either a concrete class or marked with @Decorator.
  3. 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.DynamicMBean interface, 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:

Related Topics

References


Articles

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