Java Dynamic Management Kit 5.1 Getting Started Guide

1.1.3.2 Expose Your MBeans in a Smart Agent

A Java dynamic management agent follows the client-server model. The agent responds to the management requests from any number of client applications that want to access the resources that the agent contains. The agent centralizes all requests, dispatches the requests to the target MBeans, and returns any responses. The agent, rather than the MBeans, handles the communication issues involved with receiving and sending data.

The central component of an agent is the MBean server. The MBean server is a registry for MBean instances, that exposes a generic interface through which clients can issue requests on specific MBeans. Clients can ask for the description of an MBean's management interface, to find out what resource is exposed through that MBean. Using this information, the manager can then formulate a request to the MBean server to get or set attributes, invoke operations, or register for notifications.

MBeans are accessible only through requests to the MBean server. Manager applications never have the direct reference of an MBean, only a symbolic object name which identifies the MBean in the agent. This preserves the client-server model and is essential to the implementation of query and security features.

The MBean server also provides the framework that allows agent services to interact with MBeans. Services are themselves implemented as MBeans, which interact with resource MBeans to perform some task. For example, a manager could decide to monitor an MBean attribute. The manager instantiates the monitoring service MBean, configures the threshold, and registers to receive the alarms that might occur. The manager no longer needs to poll the agent, but will automatically be notified whenever the attribute exceeds the threshold.

The library of services contains the logic that is necessary for implementing advanced management policies, such as the following.

You can also develop your own service MBeans to meet your management needs, such as logging and persistence services, which are typically platform-dependent.