What is JMX?
By daniel on Sep 28, 2006
What is JMX?
To make it short, JMX is a technology that lets you implement management interfaces for Java applications.
A management interface, as defined by JMX, is composed of named objects -
called MBeans (Management Beans). MBeans are registered with a name
(an ObjectName) in an MBeanServer.
To manage (a) resource(s) in your application, you will write an MBean that defines its management interface, and then register that
MBean in your MBeanServer.
The content of the MBeanServer can then be exposed through various protocols, implemented by protocol connectors, or protocol adaptors.
A protocol connector (e.g. the JMX RMI Connector) exposes the MBeans
as they are - so a remote client sees the same model than a local client.
A protocol adaptor (e.g. an SNMP adaptor, or HTML adaptor) performs (or provides hooks to let you perform) a model mediation - to adapt the model to what a client of that protocol (e.g. SNMP Manager, or Web Browser) would expect to see.
Today there is one standard connector defined for JMX - which is the RMI Connector, and comes in two flavors: RMI/JRMP and RMI/IIOP. There's also a JMX WebServices Connector in the making - which is being defined by JSR 262.
There are also a number of non-standard connectors and adaptors, either free or commercial, that have been implemented by the community.
A good place to start learning about JMX is the Trail: Java Management Extensions (JMX) from the online Java Tutorials.
More on JMX: Looking for JMX Overview, Examples, and More...
Are there examples of concrete and real situations where JMX has been used, and how?
You will find more on tools/products using JMX on the JMX Home Page.
Using JConsole to Monitor Applications
Mandy Chung's Blog - lots of articles on JVM management.
Understanding JMX Technology
Getting Started with Java Management Extensions (JMX): Developing Management and Monitoring Solutions
GlassFish Project - AMX (Appserver Management EXtensions) home page
Managing and Monitoring Web Services in Project GlassFish
Using Custom MBeans to Extend the GlassFish Administration System
Managing OpenDS with JMX and JConsole
... and also somewhat more adventurous applications!
What is the difference between MBeans and EJBs?
An EJB lives in an Application Server container. It usually implements business logic. An MBean lives in an MBeanServer, and usually implements management logic (configuration, monitoring, etc)...
See the comments below for a little more flesh ;-)
Note also that JMX is a J2SE technology - it's now part of the JDK - and can be use to manage and monitor both J2EE applications and plain J2SE applications.
Got more questions?
What JMX is not...
Well now that we have gone through what JMX is, let's see some examples of what JMX(tm) (Java Management Extensions) is not:
- A corporation,
- Some kind of medication,
- Some sportswear socks for men and women,
- An abstract work of art [image: gurgul-jmx.jpg],
- A popular rock band,
- An oven to bake bread...
And no, before you ask, that's not where JMX 2.0 is being baked ;-)