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

## Chapter 6

## Discovery and Lookup Services

The Java Management Extensions (JMX) Remote API Specification 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, in the following sections:

- "Getting Started With Lookup Services"
- "Using the Service Location Protocol (SLP)"
- "Using the Jini Network Technology"
- "Using the Java Naming and Directory Interface (JNDI) API With an LDAP Backend"

For more information about these infrastructures, see the “References” section of the Java Management Extensions Remote API 1.0 Specification.

## Getting Started With Lookup Services

Lookup services can be used by JMX agents and JMX clients. 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 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 and its accompanying examples demonstrate how to use lookup services to advertise and find JMX agents. The procedure is similar for all three infrastructures. The main difference is that in SLP and JNDI, the agent registers addresses with the lookup service, whereas when using the Jini network technology, the agent registers a JMX connector stub with the lookup service.

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 Remote API specification for using the SLP lookup service to advertise and find JMX agents:

1. The agent creates one or more JMX connector servers.
2. For each connector to expose, the 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.
3. The client queries the SLP lookup service, and retrieves one or more addresses that match the query.
4. Finally, the client obtains a connector that is connected with the server identified by a retrieved address.

The JMX Remote API specification defines URL schemes which are compliant with the SLP protocol. See the Java Management Extensions (JMX) Remote API Specification. The specification also defines mandatory and optional SLP lookup attributes that are provided at registration time.

## Using the Jini Network Technology

The JiniTM Network Technology is an open software architecture that enables developers to create services that are adaptable to changes in the network. The Jini specification offers a standard lookup service. A running Jini lookup service can be discovered with a simple API call.

The following steps summarize the procedure defined in the JMX Remote API specification for using the Jini lookup service to advertise and find JMX agents:

1. The agent creates one or more JMX connector servers.
2. For each connector to expose, the agent registers a JMX connector stub with the Jini lookup service, possibly giving additional attributes that qualify the agent and/or the connector, and can be used as filters.
3. The client queries the Jini lookup service, and retrieves one or more connector stubs that match the query.
4. Finally, the client connects directly to the server using the provided connector stub.

The JMX Remote API specification defines bindings with Jini technology based entries. See the Java Management Extensions (JMX) Remote API Specification. The specification also defines mandatory and optional entries to specify when registering an agent connector.

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

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

The JMX Remote API specification details how an LDAP server can be used to store and retrieve information about JMX connectors exposed by JMX agents.

The following steps summarize the procedure defined in the JMX Remote API specification for using the JNDI lookup service:

1. The agent creates one or more JMX connector servers.
2. For each connector to expose, the 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.
3. The client queries the JNDI lookup service, and retrieves one or more addresses that match the query.
4. Finally, the client obtains a connector that is connected to the server identified by a retrieved address.

The JMX Remote API specification defines an LDAP schema for registering addresses and explains how a client can discover a registered agent. See the Java Management Extensions (JMX) Remote API Specification. The specification also defines a lease mechanism.

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.