From Wikipedia, the free encyclopedia
Java Management Extensions
(JMX) is a Java technology that
supplies tools for managing and monitoring applications, system objects,
devices (e. g. printers) and
service oriented networks. Those resources are represented by
objects called MBeans (for Managed
Bean). In the API, classes can be dynamically
loaded and instantiated. Managing and monitoring applications can
be designed and developed by Java Dynamic Management
JMX 1.0, 1.1 and 1.2 were defined by JSR 003 of the
Java Community Process. As of
2006, JMX 2.0 is being developed under JSR 255. 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 is being developed
under JSR 262.
Adopted early on by the J2EE community, JMX
has been a part of J2SE since version 5.0.
It is a trademark of Sun Microsystems,
JMX is based on a 3-level architecture:
- The Probe level contains the probes (called MBeans) instrumenting the resources. Also
called the Instrumentation level.
- The Agent level, or MBeanServer, is the core of JMX.
It is 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 frameworks (RMI, IIOP, JMS,
WS-* …), while an
adaptor adapts the API to another protocol (SNMP, …) or to
Web-based GUI (HTML/HTTP, WML/HTTP, …).
Applications can be generic consoles (such as JConsole and MC4J), or
domain-specific (monitoring) applications. External applications
can interact with the MBeans through the use of JMX connectors and
protocol adapters. Connectors are used to connect an agent with a
remote JMX-enabled management application. This form of
communication involves a connector in the JMX agent and a connector
client in the management application.
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.
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 with the Java EE 6 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 (transactional monitor,
JDBC driver, etc.). They can be used for getting and setting
applications configuration (pull), for collecting statistics (pull)
(e.g. performance, resources usage, problems) and notifying events
(push) (e.g. faults, state changes).
There are two basic types of MBean:
- Standard MBeans implement a business interface
containing setters and getters for the attributes and the
operations (i.e., methods).
- Dynamic MBeans implement the
javax.management.DynamicMBean interface which provides a way to
list the attributes and operations, and to get and set the
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 (for
example, the JavaServer Faces 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.
- It has an appropriate constructor. That is, one of the
following is the case:
- The class has a constructor with no parameters.
- The class declares a constructor annotated @Inject.
No special declaration, such as an annotation, is required to
define a managed bean.
Additional types are Open MBeans, Model MBeans
and Monitor MBeans. Open MBeans are dynamic
MBeans that rely on the basic data types. They are self-explanatory
and more user friendly. Model MBeans are dynamic MBeans
that can be configured during runtime. A generic MBean class is
also provided for dynamically configuring the resources during
An MBean can notify the MBeanServer of its internal changes (for
the attributes) by implementing the
javax.management.NotificationEmitter. The application interested in
the MBean's changes registers a listener
(javax.management.NotificationListener) to the MBeanServer.
An MXBean (Platform MBean) is a special type of MBean
that reifies Java
Virtual Machine subsystems such as memory pools, garbage
collection, multi-threading, JIT compilation,
An MLet (Management applet) is a utility MBean to load,
instantiate and register MBeans in the MBeanServer from a XML description. The format of the XML
descriptor is: 
<MLET CODE = ''class'' | OBJECT = ''serfile''
ARCHIVE = ''archiveList''
[CODEBASE = ''codebaseURL'']
[NAME = ''objectName'']
[VERSION = ''version'']
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,
Application Server 10g and Sun
Java System Application Server.
- Systems management tools that
support the protocol include IBM Director,HP OpenView, Zyrion, Zenoss, Hyperic,Empirix OneSight
and GroundWork Monitor.
- JMX is also supported by servlet containers such as Apache Tomcat.
- MX4J  is Open Source JMX for Enterprise
- jManage  is an open
source enterprise-grade JMX Console with web and command-line
- MC4J  is an open source visual console for
connecting to servers supporting JMX
JSR 003: JavaTM Management
Extensions (JMXTM) Specification
JSR 255: JavaTM Management
Extensions (JMXTM) Specification, version 2.0
JSR 160: JavaTM Management
Extensions (JMX) Remote API
JSR 262: Web Services
Connector for Java Management Extensions (JMX) Agents
Using JConsole to Monitor
MC4J is a project to create
management software for J2EE application servers and other Java
"MLet (Java 2 Platform SE
Microsystems. http://java.sun.com/j2se/1.5.0/docs/api/javax/management/loading/MLet.html. Retrieved
Apache Tomcat 6.0: Monitoring
and Managing Tomcat (Tomcat manual)
- J. Steven Perry: Java Management Extensions, O'Reilly,
- Marc Fleury,
Juha Lindfors: JMX: Managing J2EE with Java Management
Extensions, Sams Publishing, ISBN 0-672-32288-9
- Jeff Hanson:
Connecting JMX Clients and Servers: Understanding the Java
Management Extensions, APress L. P., ISBN 1-59059-101-1
- Benjamin G Sullins, Mark B Whipple : JMX in Action:
You will also get your first JMX application up and running,
Manning Publications Co. 2002, ISBN 1-930110-56-1