6 Discovery and Lookup Services

The Java Management Extensions (JMX) Specification, version 1.4 describes how you can advertise and find JMX API agents by using existing discovery and lookup infrastructures. The specification does not define any discovery and lookup APIs specific to JMX technology.

This chapter provides a brief outline of existing discovery and lookup infrastructures that you can use with JMX technology.

Getting Started with Lookup Services

JMX agents and JMX clients can use lookup services. A single JVM can contain many JMX agents and/or JMX clients.

A JMX agent is a logical server application composed of the following features:

  • One managed bean (MBean) server
  • One or more JMX connector servers that allow remote clients to access the MBeans contained in that MBean server

A JMX client is a logical client application that opens a client connection with a JMX agent.

The Java Management Extensions (JMX) Technology Tutorial demonstrates how to use lookup services to advertise and find JMX agents.

Note:

The use of existing discovery and lookup services is optional. Alternatively, you can encode the addresses of your JMX API agents in the form of URLs, and communicate these URLs to the manager.

Using the Service Location Protocol (SLP)

The Service Location Protocol (SLP) provides a framework that allows networking applications to discover the existence, location, and configuration of networked services in enterprise networks.

The following steps summarize the procedure defined in the JMX Specification for using the SLP lookup service to advertise and find JMX agents:

  • The JMX agent creates one or more JMX connector servers.
  • For each exposed connector, the JMX agent registers the address with the SLP lookup service, possibly giving additional attributes that qualify the agent and/or the connector, and can be used as filters.
  • The JMX client queries the SLP lookup service, and retrieves one or more addresses that match the query.
  • Finally, the JMX client obtains a connector that is connected with the server that is identified by a retrieved address.

In the JMX Specification, the JMX Remote API Specification section defines URL schemes which are compliant with the SLP protocol. The specification also defines mandatory and optional SLP lookup attributes that are provided at registration time.

Using the Java Naming and Directory Interface (JNDI) API With an LDAP Backend

The Java Naming and Directory Interface (JNDI) API is a standard extension to the Java platform. It provides Java technology-enabled applications with a unified interface to multiple naming and directory services.

The JMX Specification describes how an LDAP server is used to store and retrieve information about JMX connectors that are exposed by JMX agents.

The following steps summarize the procedure defined in the JMX Specification for using the JNDI lookup service:

  • The JMX agent creates one or more JMX connector servers.
  • For each connector to expose, the JMX agent registers the address with the JNDI lookup service, possibly giving additional attributes that qualify the agent and/or the connector, and can be used as filters.
  • The JMX client queries the JNDI lookup service, and retrieves one or more addresses that match the query.
  • Finally, the JMX client obtains a connector that is connected to the server that is identified by a retrieved address.

In the JMX Specification, the JMX Remote API Specification section defines an LDAP schema for registering addresses and explains how a client can discover a registered agent. The specification also defines a lease mechanism.