Invoking a method

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:
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.
While an agent is running, the m-beans are stored in the repository. The Java Dynamic Management Kit provides the following types of repository:
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.
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:
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:
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.
An application that includes the framework and an adaptor provides remote access for management operations without the need for any further development.
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:
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:
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:
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:
CLASSPATH environment variable of the agent.
|
http://host:port
|
Designing the Base Agent
A base agent is a container in which m-beans are instantiated and run. A base agent consists of:
An agent consists of a base agent and the m-beans instantiated during the lifetime of the base agent.
A c-bean consists of two components:
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.
CLASSPATH environment variable of the agent.
CLASSPATH environment variable of the job tool.
|
prompt% /opt/SUNWconn/jaw/bin/job
|
|
C:\> "C:\Program Files\SUNWconn\jaw\bin\job"
|
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:
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