Sun GlassFish Message Queue 4.4 Developer's Guide for JMX Clients

JMX Architecture

The JMX Specification defines an architecture for the instrumentation and programmatic management of distributed resources. This architecture is based on the notion of a managed bean, or MBean: a Java object, similar to a JavaBean, representing a resource to be managed. Message Queue MBeans may be associated with individual resources such as brokers, connections, or destinations, or with whole categories of resources, such as the set of all destinations on a broker. There are separate configuration MBeans and monitor MBeans for setting a resource’s configuration properties and monitoring its runtime state.

Each MBean is identified by an object name, an instance of the JMX class ObjectName conforming to the syntax and conventions defined in the JMX Specification. Object names for Message Queue MBeans are either defined as static constants or returned by static methods in the Message Queue utility class MQObjectName; see Object Names for further information.

An MBean provides access to its underlying resource through a management interface consisting of the following:

Client applications obtain MBeans through an MBean server, which serves as a container and registry for MBeans. Each Message Queue broker process contains an MBean server, accessed by means of a JMX connector. The JMX connector is used to obtain an MBean server connection, which in turn provides access to individual MBeans on the server. Configuring or monitoring a Message Queue resource with JMX requires the following steps:

  1. Obtain a JMX connector.

  2. Get an MBean server connection from the JMX connector.

  3. Construct an object name identifying the particular MBean you wish to operate on.

  4. Pass the object name to the appropriate methods of the MBean server connection to access the MBean’s attributes, operations, and notifications.

  5. Close the MBean server connection.

See Chapter 2, Using the JMX API for code examples illustrating the technique for various MBean operations.