Home > Articles > Programming > Java

Introduction to JMX

Basically, Java Management Extensions (JMX) is to management systems what JDBC (Java Database Connectivity) is to databases. Discover why you should use this this powerful technology to serve as a layer between your applications and arbitrary management systems.
This chapter is from the book

The Java Management Extensions (JMX) specification2 defines a Java optional package for J2SE3 that provides a management architecture and API set that will allow any Java technology–based or accessible resource to be inherently manageable. By using JMX, you can manage Java technology resources. You can also use Java technology and JMX to manage resources that are already managed by other technologies, such as SNMP4 and CIM/WBEM.5

JMX introduces a JavaBeans model for representing the manageability of resources. The core of JMX is the simple, yet sophisticated and extensible, management agent for your Java Virtual Machine (JVM) that can accommodate communication with private or acquired enterprise management systems. JMX also defines a set of services to help manage your resources. JMX is so easy to use and is so suited for the Java development paradigm that it is possible to make an application manageable in three to five lines of code.

Basically, JMX is to management systems what JDBC (Java Database Connectivity)6 is to databases. JDBC allows applications to access arbitrary databases; JMX allows applications to be managed by arbitrary management systems. JMX is an isolation layer between the applications and arbitrary management systems. So why do we need this layer anyway?

2.1 Why We Need JMX

2.1.1 Choosing a Management Technology

As we saw in Chapter 1, many different management technologies are being used in different areas of the industry. CMIP7 dominates the telephony management market. SNMP dominates the device and network management market. Because this book is about developing Java applications and systems, let's narrow our focus to those technologies used by Java-based resources. Most Java-based resources today will be part of applications.

Even though SNMP is supported by some applications and middleware, it is not widely used for application management. One of the most commonly cited reasons for this is that many application vendors and management vendors have felt that the granularity of security in SNMP is not sufficient to use it for configuration updates and sensitive information. Therefore SNMP is often seen as useful only for read-only management of more or less public data and events. SNMP also does not have a natural model for operations on managed resources. Operations must be represented as a settable attribute. Sometimes this can be a difficult representation to map. Dependencies and associations can also be difficult to represent in SNMP.

CIM defines a more natural way to represent management data and addresses some of the weaknesses just described. It has extensive models for systems and devices, but the application management models are still emerging. The fact remains that there is no dominant management technology for the management of applications.

This would not be such a big problem if there were a single, dominant management systems vendor. If that were the case, you could use the management technology chosen by that vendor. Unfortunately, life is not that simple. Today the enterprise and application management market is pretty evenly split between Tivoli Systems8 and Computer Associates,9 who use their own proprietary technology for their manager-agent infrastructure.

If you have to manage an application or resource that runs on only one operating system, or on one vendor's systems, then choosing a management technology can be guided (or dictated) by the preferences of that vendor. Microsoft's Windows,10 IBM's AIX,11 Sun's Solaris,12 and Hewlett-Packard's HP-UX13 each has its own management system. However, one of the great things about Java has been the ease in which applications can be ported to and supported on many different vendors' systems. This means that most Java-based applications run on many platforms. If you are developing managed software products, you may be pressured to support multiple management technologies and systems because every vendor will want you to make your Java resources manageable by its management system.

Just to add to the list of management technologies you need to support, customers may have installed enterprise management systems that they will want to use to manage your application. In fact, they may or may not buy your application, depending on whether or not it can be managed by their existing enterprise management software. Your customers cannot be expected to replace their existing enterprise management systems just to accommodate your application. If you supply your own management system, your customers may still not be happy. They may not want yet another management console to watch and understand just to manage your application. Adding another console mitigates the console consolidation benefits of their enterprise management systems.

If you are a developer or architect working for a vendor of cross-platform applications, you will find yourself between a rock and a hard place. The rock is that your marketplace may be demanding that your software be manageable. To appease that marketplace, the software will need support for multiple management technologies. The hard place is that the cost of developing support for one management technology is expensive. This cost includes the learning curve, design and development, and maintaining currency with those technologies as they continue to advance. The cost of developing support for multiple technologies may very well exceed the potential new sales. This makes the business case for creating manageable applications and systems very hard to maintain and contain.

As a result, the potential return on investment may not motivate you to instrument appropriately for manageability. In fact, you may choose to write your own application-specific management system to solve a particular problem quickly, and not implement it for any external management technology. You can see how this adds to the populations of unique, nonstandard management systems and unmanageable applications.

A single suite of uniform instrumentation for manageability, like JMX, makes it cost effective to develop new applications with management capability. You can use JMX to instrument your Java applications. You can also use JMX to provide access to the manageability capabilities of your non-Java applications via Java Native Interface (JNI) and wrappers. Because JMX is centered on an architecture for pluggable adapters that allow any management technology to manage your resources, you have the best of both worlds: instrumenting your application with one management technology, and being manageable by many different management systems.

2.1.2 Dealing with Diversity

One of the primary challenges in managing applications is their diversity. This diversity is also a challenge for developers! Applications today vary widely in purpose, size, architecture, and criticality. Very little is common across all application types. Application architecture trends are increasing the diversity rather than settling the industry on a few de facto standard approaches.

JMX can be used to enable management of a wide variety of application architectures. JMX allows you as a developer to build your skills on one management technology that you can then apply to lots of application projects, today and in the future. Using JMX to enable this variety of application types benefits management systems vendors as well. They can support JMX well and be able to manage a wide variety of applications. Some of the application types that JMX is suited for are centralized applications, distributed applications, Internet applications, e-business applications, and service-oriented applications. Centralized Applications

Centralized applications, such as payroll and accounting, are backed by a database on a high-end server and usually accessed by a limited set of users, like a financial department. Managing centralized applications entails ensuring high availability and performance throughput because they can be a single point of failure. The clients of these distributed systems are usually other programs, which expect lightning-fast response times. Distributed Applications

Distributed applications, such as mail systems, usually require groups of small and midrange server systems to be running at all times, and they are accessed throughout the enterprise. Managing distributed applications is often a scaling problem: Many, many servers must be managed (i.e., available, connected, and performing well), as well as the networks that connect them, in order to simply ensure the application is available to its users. Generally the clients require proprietary software, so client software distribution and configuration must be managed as well. Internet Applications

The introduction of the intranet/Internet concept precipitated a new class of application that connects the end user to existing, traditional, centralized applications. The new application facilities range from Web-accessible corporate personnel directories to Web-based order-tracking systems that benefit customers and reduce order management costs. These types of applications make it easier to access corporate information inside traditional applications, and they reduce the number of personal contacts necessary. Managing Internet applications entails keeping several layers of applications available to each other and the network: Web servers, application servers, back ends. Browsers must be appropriately configured. E-Business Applications

The next generation of autonomous, Web-based applications is rapidly being developed and deployed in the new business environment. These applications embody e-commerce in the form of catalogs, shopping, marketplaces, and auctions. The move of the supply chain to the Internet will drive the next set of critical, distributed business-based applications. These applications move the heart of the business—buying supplies and selling products—to the Internet. Managing e-business applications is challenging because applications may span enterprise boundaries and use unreliable protocols like HTTP. Service-Oriented Applications

Service-based architectures are currently emerging where IT resources across the network appear, move, and disappear. Relationships between applications can be just-in-time and fleeting. Managing the dynamic topologies, dependencies, and availability of these applications in this environment will be difficult at best.

Each of these classes of applications has its own management challenges. However, all of these application types execute across multiple hosts, operating systems, and corporations. They incorporate existing traditional and emerging application models. They are no longer just client-server, they are now client-middleware-server. These new application types are business critical, creating the need for them to be uniformly controlled and managed by a business's existing management systems with the same diligence as traditional applications. JMX is flexible and extensible enough to be taken advantage of in all of these diverse types of application architecture.

2.1.3 Being Managed by Multiple Management Applications

As we discussed in Chapter 1, there are many different types of management applications: distribution, inventory, topology, configuration, operations, event, automation, monitoring, and performance. You will probably want your application to be managed by several of these. Without JMX, you might have to implement explicit support for each type of management application. If you're using JMX combined with JMX adapters, the same instrumentation can be used to support and interact with most or all of these applications.

2.1.4 Supporting Application-Specific Management Systems

Your application will need to be installed, configured, monitored, and maintained. This means that you must implement your own management system—that is, an application-specific management system—that supports these tasks. Otherwise, you will be dependent on a management system being available in your customer's environment. This dependency may limit sales if some of your customers have a different management system, or even no management system. Applications in the market today have their own proprietary instrumentations to communicate with their internal management systems, as well as instrumentation to connect to other management systems. We've seen how JMX can be used to interact with multiple management technologies and management applications. In the same vein, JMX can be used to drive an internal or application-specific management system, as well as an external management system.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020