Getting Started with the Java Dynamic Management Kit 4.0

Chapter 1 What is the Java Dynamic ManagementTM Kit ?

Introduction

The Java Dynamic ManagementTM Kit is a JavaTM based solution for building and distributing management intelligence into system, application, and network devices. It achieves this by providing a set of Java classes and tools that simplify the development of dynamically extensible agents.

An agent is an application which provides one or more services. Agents act as invisible assistants, alerting you to potential problems throughout the network or performing management tasks without human intervention. Agents are smart, autonomous, and dynamic. They can download management services from the management web server, pulling new management services as soon as they become available. This allows new management services to be implemented and started at any time.

How Is It Different?

Firstly, network management, under the current paradigm, is performed by management applications. These management applications are aided by agents. The agents act as interpreters and filters, sending commands to the network elements they control and collecting information about them. They are usually situated near the network elements they control, which means that these agents are limited in nature, as they contain little management intelligence and can only perform basic network management operations.

Secondly, and from a wider perspective, existing system, application, and network management systems are implemented with diverse protocols and technologies. Developers must choose a single management technology for a portion of the target market. In some cases, developers may implement multiple management technologies, in order to provide more complete coverage of their potential markets. Frequently, developers choose not to implement any management technology, in order not to be encumbered in the market.

The Java Dynamic Management Kit solves both of these problems. It is a single suite of products offering a uniform instrumentation for managing system, application, and network management systems. It is also a key enabling technology for the service-driven network. The service-driven network is a new approach to the provision of network computing that concentrates on the services you want to provide. These services range from the low-level services that manage relationships between networked devices to the value-added services you provide to end-users. These services drive your network. With the Java Dynamic Management Kit, services are incorporated directly into agents. Agents are granted permission to perform management tasks themselves, enabling management intelligence to be distributed throughout the whole network.

Thus, the Java Dynamic Management Kit opens the door to new types of lightweight, flexible management applications that can be created, deployed, enhanced or deleted in real time.

What Other Benefits Does It Offer?

The Java Dynamic Management Kit is different in that it offers more functionality than any other network management product of its kind. This unique combination of features gives the Java Dynamic Management Kit a wide domain of application.

The Java Dynamic Management Kit supports management protocols, such as SNMP. It also uses a dynamic web-based pull mechanism enabling new services to be downloaded from the Web server at runtime. Services are not only implemented inside devices, but can also be network-based, stored as files in very simple Web pages in the same way as Java technology-based applets. This dynamic, on-demand paradigm means that it is no longer necessary to know what will need to be configured, managed, and monitored in the future or in advance of network deployment. Services can be created and downloaded as needed. Autonomous management functionality is yet another key feature of the Java Dynamic Management Kit, allowing a very large installed base to be managed.

How Does It Work?

The Java Dynamic Management Kit relies on Java Management extensions (JMX) principles to manage resources. In order to ensure that your resource is a manageable resource, you need to make sure that it adheres to the JMX specification, as the JMX instrumentation level provides a specification for implementing JMX manageable resources. Manageable resources are implemented as Managed Beans, or simply MBeans. An MBean is a manageable resources that conforms to certain design patterns and may be any resource you wish to manage (for example, an application, an implementation of a service, a device, a user, and so forth). These resources are developed in Java, or at least offer a Java wrapper, and have been instrumented so that they can be managed by JMX-compliant applications. For more information regarding MBeans, please refer to "MBeans".

The Java Dynamic Management Kit is the first commercial product to implement the public specification for the Java Management extensions (JMX). JMX defines an architecture, design patterns, APIs, and services for application and network management, all under a single umbrella specification. For more information regarding JMX, see the Java Management Extensions specifications document provided with the Java Dynamic Management Kit.

One of the greatest advantages of the Java Dynamic Management Kit is that it allows you to manage resources from a remote location. Thus, you can manipulate proxy objects which transparently map onto MBeans in a remote agent.

You can access all remote JMX manageable resources by:

The manager can also add new remote JMX manageable resources by:

The Java Dynamic Management Kit greatly simplifies the development of management applications by providing multi-protocol communication between the manager side and the agent side. Devices or applications can be managed directly via a basic Web browser or through an existing SNMP management application. An extensible set of protocol adaptors (for example, HTTP/TCP, RMI, SNMP) is provided to allow developers to adapt their applications to the local communication environment.

To create brand new agents, use a managed object generator (proxygen), which is provided with the Java Dynamic Management Kit. With this tool, you can create applications with automatically-generated remote access modules that handle communication support and protocol transparency. Simply put, you can create a proxy object for each JMX object you wish to manage remotely.

The Java Dynamic Management Kit also provides a toolkit for developing SNMP agents and managers, including the mibgen compiler, which takes as input a set of SNMP MIBs and generates standard MBeans that implement the MIBs.

What Development Tools Are Provided?

The Java Dynamic Management Kit provides:

Key Concepts

Figure 1-1 below shows the key concepts for the Java Dynamic Management Kit.

The five keywords are MBean server, MBeans, adaptors, connectors, and proxy MBeans.

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

Graphic

MBean Server

The MBean server, referred to as the framework in previous releases, is a registry for JMX manageable resources which are exposed to management operations in an agent. It provides a management framework with services for manipulating JMX manageable resources that is protocol-independent and information model-independent. All management operations performed on these resources are done through the MBean server management interface. You can create and manage objects by registering them within the MBean server, thus, making them visible to management applications. The MBean server includes a library of reusable core agent services in the form of manageable objects, as specified by Java Management extensions (JMX). These services include mlet, timer, monitoring and filtering.

You can register objects in the MBean server through:

Any JMX manageable resource that you want to access for management operations must be registered in the MBean server. This MBean needs to be assigned a unique object name. The manager and the agent then use this object name to identify the object on which it is to perform a management operation. If you do not specify the object name explicitly, the MBean implementation may itself provide a name by default. It is possible to have multiple MBean servers within the same Java Dynamic Management Kit agent.

MBeans

JMX's instrumentation level provides standards for implementing JMX manageable resources. The instrumentation of a given manageable resource is provided by one or more Managed Beans, or MBeans (previously written m-beans). An MBean is a Java object that conforms to certain design patterns for exposing attributes and operations. These attributes and operations enable any Java Dynamic Management agent to recognize and manage the MBean. The design patterns for MBeans give the developer explicit control over how a resource, device or application will be managed. For example, attribute patterns enable you to make the distinction between a read-only and a read-write property in an MBean. The set of all attributes and operations exposed to management through the design patterns is called the management interface of an MBean. MBeans implement a management interface which defines the attributes and operations accessible for management. Any object that you want to make accessible through the MBean server must be represented as an MBean, including the resources you want an agent to manage and any services that you want to provide to manage these resources. MBeans can both generate and propagate notification events to remote management applications. For more information regarding managing MBeans remotely, please refer to "Proxy MBeans" and "Generic Proxy MBeans". MBeans must be developed according to the rules specified by Java Management extensions (JMX).

The JMX architecture enables you to carry out certain operations on a particular agent, by going through that agent's MBean server. These operations are as follows:

You can manage a new MBean as soon as it is registered within the MBean server. An MBean can be created and registered by:

MBeans can also be downloaded from a Web server and plugged into an agent at any time, in response to a demand by the management application. This is called dynamic class loading and means that future services and applications can be loaded on-the-fly and without downtime once they have been deployed on the network. For example, dynamic class loading can be used to provide rapid, low-cost delivery of end-user applications across very large bases of Java technology-enabled devices, such as desktop PC's or Web phones.

The management services supplied with the Java Dynamic Management Kit are implemented as MBeans. You can also write the MBeans representing objects you wish to manage. These objects could include the actual resources you want to manage and the value-added services provided to help manage resources. The Java Dynamic Management Kit does not impose any restrictions on where compiled MBean classes are stored. They can be stored at any location specified in the CLASSPATH environment variable of the agent, or at a remote site.

You can develop two types of MBeans:

Standard MBeans

Standard MBeans are Java objects that conform to certain design patterns derived from the JavaBeans component model. Standard MBeans allow you to define your management interface as a Java Interface and this interface, in turn, defines the handles that are exposed to management of that particular resource. The methods for reading and writing the MBean's attributes and for invoking its operations are described in this management interface. Standard MBeans are defined statically, in that the elements of their management interface are defined at compilation time and cannot be controlled or altered at runtime. They are the quickest and easiest type of MBeans to implement when you want to create new MBeans for new manageable resources where their data structure is defined in advance and is unlikely to change often.

Dynamic MBeans

Dynamic MBeans allow your application or domain specific manager to define the management interface for a resource at run time. This provides a simple way to wrap existing non-MBean style or even non-JavaTM technology based resources and offers greater flexibility than standard MBeans. Dynamic MBeans are more suited to management structures that change over time and are, hence, dynamic. Dynamic MBeans allow manageable resources to be flexible because they have a pre-defined interface which allows attributes and operations to be exposed only at run time.

Proxy MBeans

A proxy MBean (referred to as a client bean or c-bean in previous releases) represents the manager view of the managed MBean, where the manager has been developed using the remote MBean server interface. This interface makes the functionality of the MBean server available in the remote management application (also referred to as the manager) and lets the manager interact directly with the MBean server of the agent, or instantiate proxy MBeans to manipulate remote MBeans transparently.

The manager accesses an MBean by performing operations on the proxy MBean, which are then propagated to the MBean. These operations are:

A Proxy MBean is generated from an MBean by using the proxygen compiler, supplied with the Java Dynamic Management Kit. A proxy MBean can only be generated from a standard MBean and is created to mirror an existing MBean. Proxy MBeans are ideal when the management interface does not need to change over time, hence, where the attributes and operations available are stable.

Generic Proxy MBeans

A generic proxy MBean acts in the same manner as a proxy MBean. However, you do not generate generic proxy MBeans using the proxygen compiler as with proxy MBeans, but simply by creating a new instance of a generic proxy MBean. Generic proxy MBeans are ideal when you want to perform operations on one MBean and when you know that the attributes and operations of that MBean will change. For example, sometimes you may have write permissions on an attribute and other times you may only be able to read the attribute. This makes generic proxy MBeans the perfect solution for dynamic management systems, where an MBean's properties are likely to change at run time. Generic proxy MBeans can be used to manage either standard MBeans or dynamic MBeans, thus, can mirror both types of MBeans.

Connectors And Protocol Adaptors

Connectors and Protocol Adaptors allows an agent to be accessed and managed by remote custom management applications. These applications could be outside the agent's Java Virtual Machine (JVM). This can be seen in the previous illustration, Figure 1-1 .

Connectors (referred to as adaptors in previous releases) connect the MBean server to management applications and enable MBeans to be instantiated and managed remotely. Every connector provides the same remote management interface, but through a different protocol, which allows remote management applications to connect to agents transparently through the network, regardless of the specific protocol. One or more connector clients can be connected to the MBean server, providing views through specific protocols of the MBeans instantiated and registered with the MBean server. The Java Dynamic Management Kit provides connectors for most major internet protocols (for example, HTTP/TCP and RMI) .

A connector is composed of two parts:

The interface of the remote MBean server is implemented by the connector client. Connectors allow management applications to be transposed onto a manager site, offering the same level of functionality at both the agent and manager side while ensuring seamless, transparent connectivity.

Protocol Adaptors have only a server component and provide connection between a remote management application and an agent, via a specific network protocol. From a manager side, you can view and manage all MBeans registered in the MBean server. This can be achieved by directly accessing the MBean server's interface through a given protocol. For example, a web browser accesses the HTML protocol adaptor directly and, therefore, a client of the HTML protocol adaptor is an HTML browser. Similarly, an SNMP manager accesses the SNMP adaptor directly. Therefore, a client of the SNMP adaptor is an SNMP manager.

In addition, the Java Dynamic Management Kit provides an SNMP toolkit that allows you to generate MBeans that support standard or proprietary MIB's, enabling new Java technology-based agents to be integrated into existing network infrastructures, including most SNMP-based management products.

Connectors and protocol adaptors enable management applications to:

For an agent to be managed remotely, it must include at least one connector or protocol adaptor. However, an agent can include any number of connectors or protocol adaptors, enabling it to be managed remotely by many managers, through different protocols. Proxy MBeans, at the manager side, are used to perform management operations on the corresponding MBeans at the agent side. These MBeans are registered with the MBean server in a manner that is protocol-independent. Neither connectors nor protocol adaptors are automatically started when they are created, which allows you to specify the port number before you start them.

JMX MBean Notification Model

The management interface of an MBean allows an MBean's agent to perform control and configuration operations on the managed resources. The JMX MBean notification model allows MBeans to broadcast management notifications. Management applications and other objects register as listeners with the broadcaster MBean. The JMX MBean notification model enables a listener to register only once and still receive all different notifications that may occur in the broadcast.

Figure 1-2 Remote Notification Mechanism

Graphic

Figure 1-2 illustrates the remote notification mechanism. This can be seen in terms of the Pull mechanism and the Push mechanism.

Adding Notification Listeners

If you want to add a listener of notifications at the agent side you need to call the addNotificationListener method on the MBean server. In this case, the notification will not be forwarded to the connector client. You can also add a listener, addNotificationListeneron the remote MBean server or on proxy MBean A.

There are two ways you can add a listener to the manager side. Firstly, you can call the appropriate addNotificationListener operation on proxy MBean A. This will transmit a call to the agent side and a protocol-dependent, appropriate listener will be created in the MBean server (L1 in Figure 1-2). This is a protocol-dependent, generated listener and is handled by the connector server. It is in charge of sending notifications throughout the network, from the agent side to the manager side, using a specified protocol. Secondly, you can call the addNotificationListener method on the remote MBean server.

The Push Mechanism

You can choose to use the Push Mechanism to push notifications from an agent to a manager. When the connectors run employ the Push Mechanism the connector server forwards the notifications to the connector client as soon as they are emitted by the MBeans. For example, you can register proxy MBean A as a listener of notifications emitted by MBean A. Thus, when MBean A, at the agent side, emits a notification, the HTTP or RMI adaptor forwards this notification to the connector client at the manager side.

The Pull Mechanism

You can choose to use the Pull Mechanism to forward notifications from an agent to a manager. This is useful, for instance, when the agent is unable to connect to a manager. For example, if there is a fire-wall in place between the agent side and the manager side. You can use the Pull Mechanism to pull notifications from the agent side to the manager side. When you create the remote MBean server you need to set the mechanism mode and the pull period. The pull period is the time period between pulls. Pulls occur when the HTTP/RMI connector server at the agent side is instructed by the manager to attempt to pull notifications. Thus, the manager decides when, and how often, it wants to retrieve notifications . For example, the pull frequency could be set to try to get notifications every thirty seconds or every minute.