Previous Next Contents Index


1


Introduction to the JavaTM Dynamic ManagementTM Kit

The JavaTM Dynamic ManagementTM Kit provides a set of Java classes and tools that simplify the development of dynamically extensible, smart agents. Such agents are applicable to network management, system management, application management, and service management. The Java Dynamic Management Kit APIs are an extension to the Java programming language.


Overview

An agent developed with the Java Dynamic Management Kit enables a manager running on a remote host to:


Key Concepts

FIGURE 1-1 shows how the key concepts for the Java Dynamic Management Kit relate to an agent and a manager. They are explained in the following subsections.

FIGURE  1-1 Key Concepts for the Java Dynamic Management Kit

The Core Management Framework

The core management framework (or, more briefly, the framework) is a registry for objects in an agent. Objects can be registered by:

Any object that you want to be managed from outside the framework must be registered. When you register an object, assign it an object name (see "Object Name" on page 41). If you do not specify the object name explicitly, the Java Dynamic Management Kit assigns a default object name to the object when it is registered. A manager uses the object name to identify the object on which it is to perform a management operation. Any object registered with the framework must be an instance of an m-bean (see "M-Beans" on page 3).

The framework is a component supplied with the Java Dynamic Management Kit.

M-Beans

A managed bean, or m-bean, is a Java object that conforms to certain design patterns. These design patterns are derived from the JavaBeansTM component model and are described in detail in Chapter 3. They enable properties, actions, and events to be defined for an m-bean. They also enable you to make the distinction between a read-only and a read-write property in an m-bean. To comply with the design patterns for m-beans, an m-bean must be a JavaBeans component.

An m-bean instance is manageable as soon as it is registered with the framework. An m-bean can be instantiated and registered by:

Any object that you want to be accessible through the framework must be represented as an m-bean. Such objects include:

You write the m-beans representing these objects yourself. Some components of the Java Dynamic Management Kit are implemented as m-beans.

While an agent is running, the m-beans are stored in the repository. The Java Dynamic Management Kit provides the following types of repository:

All the information in memory is lost when the agent is stopped. When an agent is started, it has to reload the information into the repository. Information in persistent storage is not lost when the agent is stopped.

The Java Dynamic Management Kit does not impose any restrictions on where compiled m-bean classes are stored. They can be stored at any location specified in the CLASSPATH environment variable of the agent, or at a remote site.

Adaptors

An adaptor connects the framework to external applications. It provides a view through a specific protocol of the m-beans instantiated and registered with the framework. An adaptor enables an external application to:

For an agent to be manageable, it must include at least one adaptor. However, an agent can include any number of adaptors, enabling it to be managed remotely through different protocols.

Some adaptors have a server component and a client component. The client component provides a Java API for developing client applications (typically, managers). This API does not depend on the underlying protocol used.

Some adaptors have only a server component. They are accessed directly by an external application. For example, a web browser accesses the HTML adaptor directly. Similarly, an SNMP manager accesses the SNMP adaptor directly.

For information on how to use the adaptors, refer to Chapter 5.

C-Beans

A client bean, or c-bean, is a stub object that represents a remote m-bean to a manager developed with the adaptor client API. Like an m-bean, a c-bean is a JavaBeans component. The manager accesses an m-bean by performing operations on the c-bean, which are propagated to the m-bean, namely:

Events emitted by the m-bean are propagated to the c-bean.

A c-bean is generated from its m-bean by using the mogen compiler supplied with the Java Dynamic Management Kit. For information on how to use mogen, refer to Chapter 6. For information on how to use the adaptor client API, refer to Chapter 7.


Benefits of the Java Dynamic Management Kit

Benefits of the Java Dynamic Management Kit include:

Dynamic Extensibility and Scalability

The Java Dynamic Management Kit eases the development of extensible agents. An agent is able to instantiate Java classes loaded from an arbitrary location. Therefore, it is possible to extend the functionality of a running agent by making new classes available at an arbitrary location and requesting the agent to load and instantiate them.

Agents developed using the Java Dynamic Management Kit are also scalable. M-beans can be registered and unregistered with the framework in an agent while it is running. By registering and unregistering new m-beans, the agent can use only what it needs when it needs it. This feature enables the size and complexity of an agent to be modified while the agent is running, without having to stop the agent.

Easy Management of Java Applications

The framework enables easy management of Java applications. For a Java application to be manageable, it only needs to be modified so that it:

The only restriction is that the registered objects have to be instances of an m-bean. This is not a serious restriction, as it does not force the existing design to be changed, nor does it require a fixed class inheritance scheme. When you design an m-bean, you do not need explicitly to take account of the interaction of the m-bean with the framework or the adaptors. This is handled for you by the design patterns for m-beans.

An application that includes the framework and an adaptor provides remote access for management operations without the need for any further development.

Easy Development of Smart Agents

Agents developed using the Java Dynamic Management Kit are smart agents. A smart agent provides the services needed to process management requests. In a smart agent, much of the processing can be done locally in the agent itself, reducing the load on the network connection between the agent and the manager. This also enables an agent to continue to work if the connection between it and its manager is lost.

Protocol Independence

The design patterns for m-beans do not depend in any way on the protocol an agent uses for communicating with external applications. This is because the adaptors interact with m-beans through the framework. New adaptors (with new protocols) can be developed and used without rewriting existing m-beans or external applications. All that is required is that the new adaptor is able to interact with the framework.


Product Components

The principal components of the Java Dynamic Management Kit are:

Framework

The framework is a registry for m-beans in an agent. It is introduced in "The Core Management Framework" on page 2. The framework also provides an event handling service, which receives event reports from m-beans and forwards them to any entity that has requested to receive them. For more information on the event handling service, refer to "Event Handling Service" on page 185.

Adaptors

An adaptor connects the framework to external applications. The adaptors are introduced in "Adaptors" on page 4. For information on how to use the adaptors, refer to Chapter 5.

Services

To simplify the development of agents for network, system, application, and service management, the Java Dynamic Management Kit supplies a set of services. They are described in the following subsections.

Base Services

The base services are the services that the framework requires to be able to function. They are supplied as separate components to enable you to customize the framework by choosing the implementation you require from among those supplied. If you do not want to use the supplied implementation of a base service, you can further customize the framework by writing your own implementation and adding it to the framework. The base services are:

For more information on the base services, refer to Chapter 10.

Class and Library Loader Services

An agent uses the class loader to obtain new classes from an arbitrary location. The library loader loads native libraries into the framework. For more information on the class and library loader services, refer to Chapter 12.

M-Let Service

The management applet or m-let service enables an agent to obtain m-beans from a remote .jar file. For more information on the m-let service, refer to "M-Let Service" on page 159.

Bootstrap Service

The bootstrap service simplifies the distribution of new releases of an agent from a central server. It is a standalone Java program that enables you to load an agent from a remote .jar file. To obtain a new version of an agent, run the bootstrap service on the system that requires the agent to be loaded and run. For more information on the bootstrap service, refer to "Bootstrap Service" on page 173.

Launcher Service

The launcher service enables all the Java Dynamic Management applications running on a single machine to share the same base agent. It also enables you to load new applications into a base agent that is already running. For more information on the launcher service, refer to "Launcher Service" on page 180.

Scheduler Service

The scheduler service enables you to create alarms for specific dates and times. The alarms or scheduler events are sent to all objects registered to receive scheduler events. It performs a function similar to that of the cron daemon of the UNIX® operating system. For more information on the scheduler service, refer to "Scheduler Service" on page 193.

Alarm Clock Service

The alarm clock service activates (or "wakes up") alarm clock event listeners at regular intervals. It is used as the basis for the scheduler service. For more information on the alarm clock service, refer to "Alarm Clock Service" on page 192.

Monitoring Service

The monitoring service enables the variation with time of a property in an m-bean to be monitored. For more information on the monitoring service, refer to "Monitoring Service" on page 198.

Discovery Service

The discovery service enables agents to be discovered by clients by using multicasting. For more information on the discovery service, refer to "Discovery Service" on page 209.

Cascading Agent Service

The cascading agent service enables you to implement a hierarchy of master agents and subagents. For more information on the cascading agent service, refer to Chapter 15.

Tools

These tools are provided with the Java Dynamic Management Kit:

Default Base Agent

To ease the testing of m-beans, the Java Dynamic Management Kit provides a base agent. This agent is ready to be started without further modification. It is a container in which m-beans can be instantiated and tested. This agent contains:

For information on how to start and stop the default base agent, refer to Appendix E.

SNMP Manager API

The SNMP manager API is a set of Java classes that simplifies the development of applications for managing SNMP agents. The agents may be developed with the Java Dynamic Management Kit, or by other means. For information on the SNMP manager API, refer to Chapter 19.


Overview of the Development Process

The main steps in developing an application with the Java Dynamic Management Kit are:

Writing the M-Beans

When using the Java Dynamic Management Kit for agent development, you write Java classes that define your application. The only restriction imposed by the Java Dynamic Management Kit is that your classes must comply with the design pattern for m-beans described in Chapter 3.

Testing M-Beans With a Web Browser

After you have compiled your m-bean classes, you are able to use a web browser to test them. You do this by connecting a web browser to a running agent (for example, the default base agent), instantiating m-beans, and performing other operations on the m-bean instances. Before connecting a web browser to an agent, ensure that:

To use a web browser to communicate with an agent, open the page given by this URL in a web browser:

http://host:port

where:

The HTML page displayed is generated by the HTML adaptor and enables you to perform the following operations on m-beans in the agent:

For detailed instructions on how to use a web browser for testing m-beans in an agent, refer to "The M-Bean Browser Web Page" on page 102.

Designing the Base Agent

A base agent is a container in which m-beans are instantiated and run. A base agent consists of:

A base agent can also contain m-beans instantiated when the base agent is started; optionally these last for the lifetime of the base agent. In designing the base agent you have to decide which m-beans you want to be instantiated when the agent is started, and which you want to be instantiated on demand.

An agent consists of a base agent and the m-beans instantiated during the lifetime of the base agent.

Generating a C-Bean

To generate a c-bean from an m-bean, use the mogen compiler. The m-bean classes input to mogen must be in the form of compiled Java classes, not source files.

A c-bean consists of two components:

For example, if you have an m-bean MyClass, the mogen compiler gives you a c-bean that consists of the following files:

For information on how to use mogen, refer to Chapter 6.

The mogen compiler generates Java source code, not compiled Java classes. For your c-beans to be accessible to a Java manager, you have to compile the files that mogen generates, and make sure that the compiled Java classes are stored at the location specified by the CLASSPATH environment variable of the manager.

Testing M-Beans With the job Tool

After you have generated c-beans, you are able to use the job tool for further testing. You do this by connecting the job tool to a running agent (for example, the default base agent), instantiating m-beans, and performing other operations on the m-bean instances. The job tool provides a graphical representation of m-beans in an agent. It is a simple example of a Java manager that can perform basic operations on m-beans in an agent.

Before using the job tool to communicate with an agent, ensure that:

To start the job tool, type the command for your operating environment:

For detailed instructions on how to use the job tool, refer to "The job Tool" on page 107.

Developing a Manager in the Java Language

Use the adaptor client API to develop a manager in the Java language. The main steps in developing a Java manager are:

The interaction between an m-bean in an agent and a c-bean in a Java manager is shown in FIGURE 1-2.

For information on how to use the adaptor client API, refer to Chapter 7.

FIGURE  1-2 Interaction Between an M-Bean and a C-Bean


Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California 94303 U.S.A.
Copyright in French

Previous Next Contents Index