Contents | Previous | Next | Java Management Extensions (JMX) Technology Overview

## Chapter 4

## Using JMX Agents

A Java Management Extensions (JMX) agent is a management entity that runs in a Java Virtual Machine (JVM) and acts as the liaison between the MBeans and the management application. The various components of a JMX agent are outlined in the following sections:

- "MBean Server"
- "Agent Services"
- "Protocol Adaptors and Connectors"

## MBean Server

The MBean server is the core component of a JMX agent. It is a registry for objects that are exposed to management operations in an agent. Any object registered with the MBean server becomes visible to management applications. However, the MBean server only exposes the management interface of an MBean, never its direct object reference.

Any resource that you want to manage from outside the agent’s JVM must be registered as an MBean in the server. The MBean server also provides a standardized interface for accessing MBeans within the same JVM, giving local objects all the benefits of manipulating manageable resources. MBeans can be instantiated and registered by:

- Another MBean
- The agent itself
- A remote management application

When you register an MBean, you must assign it a unique object name. A management application uses the object name to identify the object on which it is to perform a management operation. The operations available on MBeans include:

- Discovering the management interface of MBeans
- Reading and writing their attribute values
- Performing operations defined by the MBeans
- Getting notifications emitted by MBeans
- Querying MBeans based on their object name or their attribute values

## Agent Services

Agent services are objects that can perform management operations on the MBeans registered in the MBean server. By including management intelligence into the agent, JMX helps you build more powerful management solutions. Agent services are often MBeans as well, allowing them and their functionality to be controlled through the MBean server. The JMX specification defines the following agent services:

- Dynamic class loading through the management applet (m-let) service retrieves and instantiates new classes and native libraries dynamically downloaded from the network.
- Monitors observe the numerical or string value of MBean attributes and can notify other objects of several types of changes.
- Timers provide a scheduling mechanism and can send notifications at predetermined intervals.
- The relation service defines associations between MBeans and maintains the consistency of the relation.

All these agent services are available in version 5.0 of the J2SE platform.

## Protocol Adaptors and Connectors

Protocol adaptors and connectors make the agent accessible from remote management applications. They provide a view through a specific protocol of the MBeans instantiated and registered in the MBean server. They enable a management application outside the JVM to:

- Get or set attributes of existing MBeans
- Perform operations on existing MBeans
- Instantiate and register new MBeans
- Register for and receive notifications emitted by MBeans

Consequently, for a JMX agent to be manageable, it must include at least one protocol adaptor or connector. The J2SE platform includes the standard RMI connector. An agent can include any number of protocol adaptors and connectors, allowing it to be managed and monitored remotely through different protocols simultaneously.

### Protocol Adaptors

Protocol adaptors provide a management view of the JMX agent through a given protocol. They adapt the operations of MBeans and the MBean server into a representation in the given protocol, and possibly into a different information model, for example SNMP. The J2SE platform does not include any protocol adaptors as standard.

Management applications that connect to a protocol adaptor are usually specific to the given protocol. This is typically the case for legacy management solutions that rely on a specific management protocol. They access the JMX agent not through a remote representation of the MBean server, but through operations that are mapped to those of the MBean server.

### Connectors

Connectors are used to connect an agent with a remote management application enabled for JMX technology, namely, a management application developed using the distributed services of the JMX specification. This kind of communication involves a connector server in the agent and a connector client in the manager.

These components convey management operations transparently point-to-point over a specific protocol. The JMX Remote API provides a remote interface to the MBean server through which the management application can perform operations. A connector is specific to a given protocol, but the management application can use any connector indifferently because they have the same remote interface.

See Chapter 5, "Using JMX Connectors to Manage Resources Remotely" for more information on standard JMX connectors.

Contents | Previous | Next | Java Management Extensions (JMX) Technology Overview Java Management Extensions (JMX), Java 2 Platform, Standard Edition 5.0

Copyright © 2004 Sun Microsystems, Inc. All rights reserved.