2 JMX Technology Architecture

Java Management Extensions (JMX) technology provides a standard API for the management and monitoring of resources. The API includes remote access, so that a remote management application can manage and monitor applications, systems, and networks.

This chapter outlines JMX architecture in the following sections:

Architecture Outline

JMX technology was developed through the Java Community Process (JCP) as two closely related Java Specification Requests (JSRs):

  • JSR 3: Java Management Extensions (JMX) Specification- defines the instrumentation and agent levels
  • JSR 160: Java Management Extensions (JMX) Remote API - defines the remote management level

The following table shows the levels in the management architecture.

Level Description
Instrumentation Resources, such as applications, devices, or services, are instrumented using Java objects called Managed Beans (MBeans). MBeans expose their management interfaces, composed of attributes and operations, through a JMX agent for remote management and monitoring. 
Agent The main component of a JMX agent is the MBean server. This is a core managed object server in which MBeans are registered. A JMX agent also includes a set of services for handling MBeans. The JMX agent directly controls resources and makes them available to remote management agents. 
Remote management Protocol adaptors and standard connectors make a JMX agent accessible from remote management applications outside the agent’s Java Virtual Machine (JVM).

Instrumenting Resources by Using MBeans

To manage resources by using JMX technology, you must first instrument the resources in the Java programming language. You can use Java objects known as MBeans to implement access to the instrumentation of resources. MBeans must follow the design patterns and interfaces defined in the JMX Specification to ensure that all MBeans provide the instrumentation of managed resources in a standardized way.

After a resource is instrumented by MBeans, it can be managed through a JMX agent. MBeans do not require knowledge of the JMX agent with which they operate.

MBeans are designed to be flexible, simple, and easy to implement. Developers of applications, systems, and networks can make their products manageable in a standard way without investing in complex management systems. Existing resources can be made manageable with minimum effort.

In addition, the instrumentation level of JSR 3: Java Management Extensions (JMX) Specification specifies a notification mechanism that enables MBeans to generate and propagate notification events to components of the other levels.

Creating a JMX Agent

A JMX agent is a standard management agent that directly controls resources and makes them available to remote management applications. A JMX agent is usually located on the same system as the resources that it controls, but this is not a requirement.

The core component of a JMX agent is the MBean server, a managed object server in which MBeans are registered. A JMX agent also includes a set of services to manage MBeans, and at least one communications adaptor or connector to enable access by a management application.

When you implement a JMX agent, you do not need to know the semantics or functions of the resources that the agent will be used to manage. In fact, a JMX agent does not even need to know which resources it will serve, because any resource instrumented in compliance with the JMX Specification can use any JMX agent offering the services that it requires. In addition, the agent does not need to know the functions of the management applications that will access it.

Managing Resources Remotely

JMX API instrumentation can be accessed either through existing management protocols such as the Simple Network Management Protocol (SNMP), or through proprietary protocols. The MBean server relies on protocol adaptors and connectors to make a JMX agent accessible from management applications outside the agent’s JVM.

Each adaptor provides a view through a specific protocol of all MBeans registered in the MBean server. For example, an HTML adaptor could display an MBean in a browser.

Connectors provide a manager-side interface that handles the communication between the manager and the JMX agent. Each connector provides the same remote management interface though a different protocol. When a remote management application uses this interface, it can connect to a JMX agent transparently through the network, regardless of the protocol.

JMX technology provides a standard solution for exporting JMX API instrumentation to remote applications, based on Remote Method Invocation (RMI). The JMX Remote API also defines an optional protocol based directly on TCP sockets, called the JMX Messaging Protocol (JMXMP). An implementation of the JMX Remote API does not have to support this optional protocol. The Java SE platform does not include the optional protocol. See JMX Technology Versions for further information.

The JMX Remote API section of the specification describes how you can advertise and find JMX agents by using existing discovery and lookup infrastructures. For examples, see Java Management Extensions (JMX) Technology Tutorial. The JMX Specification does not define its own discovery and lookup service. The use of existing discovery and lookup services is optional. Alternatively you can encode the addresses of your JMX agents in the form of URLs, and then communicate these URLs to the manager.