Previous Next Contents Index


8


Tools for Browsing M-Beans

The Java Dynamic Management Kit provides debugging tools that enable you to preview an m-bean under development by instantiating it and by performing operations on the m-bean instance.


Tools Provided

The tools for browsing m-beans that the Java Dynamic Management Kit provides are:

M-Bean Browser Web Page

The m-bean browser web page is generated by the HTML adaptor. It enables you to use a web browser to display a textual representation of m-beans in an agent. You do not have to generate c-beans to be able to use the m-bean browser web page, but you are limited to using the HTTP protocol for accessing m-beans.

The job Tool

The job tool provides a graphical representation of the m-beans in an agent. It also provides an example of a simple Java manager. To use the job tool to preview an m-bean, the corresponding c-bean must already have been generated. The job tool is able to receive events from an agent and, if necessary, respond to events it receives. For example, if an m-bean instance is added to an agent, the instance is displayed in the job tool window. If an m-bean instance is deleted from an agent, it is removed from the job tool window.


The M-Bean Browser Web Page

The HTML adaptor enables you to use a web browser to preview m-beans in an agent. The HTML adaptor obtains management information from m-beans and generates web pages representing this information. These web pages enable you to perform management operations on m-beans.

Connecting a Web Browser to an Agent

Before connecting a web browser to a Java Dynamic Management agent, ensure that:

To connect a web browser to a Java Dynamic Management agent, open this page in a web browser:

http://host:port

where:

If security is implemented for the HTML adaptor in the agent, you are asked to type your login and password for accessing the agent.

The m-bean browser web page is opened in the web browser. An example of its content is shown in FIGURE 8-1.

FIGURE  8-1 M-Bean Browser Web Page

Operations on an M-Bean

The m-bean browser web page enables you to preview an m-bean under development by:

 

To Read or Write the Properties of an M-Bean Instance

1. In the m-bean browser web page, from the list of recorded managed objects, select the m-bean that you want to read or write the properties of.

This takes you to the m-bean properties web page. An example of its content is shown in FIGURE 8-2.

FIGURE  8-2 M-Bean Properties Web Page

2. Specify the new values of any read-write (RW) properties that you want to change.

The Value field for a read-write property is a different color from the web page background. The Value field for a read-only property is the same color as the web page background. The Value field for a property that is an array contains a link to a page that displays the individual elements in the array.

3. Click Apply.

If a reload period has been specified, it is reset to 0 when you click Apply.

Specifying the Reload Period
If you specify the reload period, the m-bean properties web page is automatically reloaded each time the reload period elapses. This updates the page with the new values of any properties that have changed since the page was last reloaded. To specify the reload period, in the Reload Period text-entry field, type the number of seconds you want between each reload and click Reload. The minimum reload period is 5 seconds. To disable reloading, specify a reload period of 0 seconds. Clicking Reload also causes the page to be updated immediately.

 

To Perform an Action on an M-Bean Instance

In the Actions area of the m-bean properties web page:

1. If the action takes any arguments, type each argument into its associated text-entry field.

The text-entry fields are arranged in the order in which the arguments are declared in the method prototype. The type of each argument is stated next to the field. In the example shown in FIGURE 8-3, the action takes a String argument and an int argument.

FIGURE  8-3 Action With Multiple Arguments

1. Click the button for the action that you want to perform.

A message is added to the bottom of the page indicating the return value of the action.

 

To Instantiate or Delete an M-Bean Instance

1. In the m-bean browser web page, click Admin.

This takes you to the Agent Administration page. Its content is shown in FIGURE 8-4.

2. In the M-Bean area, fill in the required information.

For more information, refer to "Information for Instantiating an M-Bean" on page 116.

3. Use the Action option button to select what you want to do:

4. Click Send Request.

A message is added to the bottom of this page indicating whether the request was processed. To confirm that the m-bean has been instantiated or deleted, follow the List of M-Beans link.

FIGURE  8-4 Agent Administration Page
 

Shortcut for Deleting an M-Bean Instance

In the m-bean properties web page, click Delete. The m-bean properties web page is shown in FIGURE 8-2.


The job Tool

The job tool provides a graphical representation of the m-beans registered with an agent. It is a debugging tool that enables you to preview an m-bean under development by instantiating it and by performing operations on the m-bean instance. It is also an example of a simple Java manager.

Starting and Connecting the job Tool

When it is started, the job tool is not connected to an agent and no m-beans are displayed. You have to connect it to the agent of which you want to preview the m-beans. Before trying to connect the job tool to an agent, ensure that:

To obtain a list of the agents that you can connect to, use the discovery option to discover them. This enables you to select the agent from a list. The job tool uses multicasting to discover agents. If you do not want to use the default parameters for discovery, you can change them.

 

To Start the job Tool

   Type the command for your operating environment:

 

To Connect the job Tool to an Agent

1. Before attempting to connect the job tool to a Java Dynamic Management agent, ensure that the agent is running.

2. Type the name of the agent that you want to connect to, into the job tool text-entry field.

If the adaptor in your agent uses the default settings, all you need to specify is the host name of the machine on which the agent is running. The default settings are RMI protocol and port 1099. If the adaptor in your agent does not use the default settings, you have to specify the protocol, host name and port in full as follows:

protocol:hostname:port

3. Click Connect.

If security is implemented for the adaptor through which you connect to the agent, you are asked to type your login and password for accessing the agent.

 

To Connect to an Agent by Using the Discovery Option

1. Click the button adjacent to the Connect button.

The Discovery window is opened as shown in FIGURE 8-5.

FIGURE  8-5 Discovery Window

2. In the Discovery window, click Discover.

A list of agents with a discovery responder listening on port 9000 that are running on your network is added to the main area of the Discovery window.

3. From the list of agents, select the agent that you want to connect the job tool to.

The name of the agent is displayed in the text-entry field of the job tool window.

4. Click Connect.

If security is implemented for the adaptor through which you connect to the agent, you are asked to type your login and password for accessing the agent.

Double-clicking an agent in the Discovery window connects the job tool to the agent.

 

To Change the Default Discovery Parameters

1. In the Discovery window, click Setup.

FIGURE  8-6 Discovery Setup Window

2. In the Discovery Setup window, specify new values for these parameters:

Time to Live

The time to live for multicast packets. It must be a positive decimal integer.

Multicast Group

The multicast group that packets will be sent to. It must be an IP address.

Multicast Port

The port number for multicast packets.


3. Click OK.

 

To Revert to the Default Discovery Parameters

   In the Discovery Setup window, click Defaults.

The job Tool Window

By default, m-bean instances in an agent are represented as icons in the main area of the job tool window, as shown in FIGURE 8-7.

FIGURE  8-7 Icon Representation of M-Bean Instances in the job Tool Window
The icon that represents an m-bean instance depends on the characteristics of the m-bean instance, as shown in TABLE 8-1.

TABLE  8-1 Icons for the job Tool

Icon
Meaning

A exists for the . It is possible to use the job tool to examine the properties and actions of the .

The is not an instance of a base service. If you delete the instance, the agent will continue to work.

A does not exist for the . The properties and actions of the are not accessible to the job tool.

The is not an instance of a base service. If you delete the instance, the agent will continue to work.

The is an instance of a base service of the agent. Do not delete an instance of a base service. If you do, the agent will no longer work.


Changing Your View of M-Beans

The job tool enables you to choose whether m-bean instances are represented as icons, or in a list. It also enables you to choose the domain of the m-bean instances that you want to view. The domain of an m-bean is part of its object name as explained in "Object Name" on page 41.

 

To View M-Bean Instances as a List

   In the job tool window, select the List option.

The m-bean instances in an agent are represented as text in a list, as shown in FIGURE 8-8. Each item in the list is the object name of an m-bean instance in an agent. To return to an icon representation, select the Icon option.

FIGURE  8-8 List Representation of M-Beans in the job Tool Window
 

To Choose the Domain

1. In the job tool window, set the Domains option to on.

A list of domains covered by the agent is added to the job tool window as shown in FIGURE 8-9.

2. From the list of the list of domains, select the domain of the m-bean instances you want to view.

Select the asterisk to view the m-bean instances in all domains. To remove the list of domains, set the Domains option to off.

FIGURE  8-9 Listing of Domains in the job Tool Window

Operations on an M-Bean

The job tool enables you to preview an m-bean under development by:

 

To Read or Write the Properties of an M-Bean Instance

1. In the job tool window, select the m-bean instance that you want to read or write the properties of.

2. Click Properties.

The properties of an m-bean instance are displayed in a separate window. An example is shown in FIGURE 8-10.

FIGURE  8-10 Example Properties Window

3. In the properties window, make the changes to any read-write properties you want to change.

The text-entry field for a read-write property is a different color from the window background. The text-display field for a read-only property is the same color as the window background.

4. Click Apply to apply your changes.

The properties window remains open. Click Close to close the properties window without applying any changes.

The properties window is not automatically updated with changes to properties that have occurred since the window was opened. To update the properties displayed, click Refresh.

 

To Perform an Action on an M-Bean Instance

1. In the job tool window, select the m-bean instance that you want to perform an action on.

2. Click Actions.

FIGURE  8-11 Example Action Window

3. In the action window, click the action you want to perform.

The action you want to perform must not take any arguments. Only actions that take no arguments are active in the method window. The names of actions that take one or more arguments are displayed but are grayed out and cannot be performed.

 

To Instantiate an M-Bean

1. In the job tool window, click Create.

FIGURE  8-12 Create Object Window for the job Tool

2. In the Create Object window, specify the information required to instantiate the m-bean.

For information, see "Information for Instantiating an M-Bean" on page 116.

3. Click OK.

 

To Delete an M-Bean Instance

1. In the job tool window, select the m-bean instance that you want to delete.

Do not select an instance of a base service. If you delete a base service, the agent will no longer work.

2. Click Delete.

You are asked to confirm that you want to delete the m-bean instance.


Information for Instantiating an M-Bean

The information you have to supply when you instantiate an m-bean is defined in the following subsections. This information consists of the components of the object name of the m-bean and other options.

Components of the Object Name of the M-Bean

The information you supply to form the object name of the m-bean is defined in the following subsections. For more information on object names, refer to "Object Name" on page 41.

Domain

The domain part of the object name of the m-bean instance specifies the domain within which the m-bean exists. It must be an unquoted text string without spaces. The domain part of an object name is optional. If you do not specify the domain, the default domain of the agent is used.

Class

The class part of the object name of the m-bean instance. If the agent does not use the default rule for obtaining the Java class of an m-bean from the class part of its object name, you must use the Java Class option to specify the Java class of the m-bean. The default rule for obtaining the Java class of an m-bean from its object name is described in "Mapping Rules for Class Names" on page 81. Class is mandatory.

For the job tool only:
Clicking the button adjacent to the Class text-entry field opens a list of the Java classes accessible to the agent. This list contains the Java class names of:

To instantiate an m-bean class that is not in this list, type its Java class name, including the package name, in the Class field. The Java class name must be an unquoted text string without spaces. When you click OK, this class is added to the list of the Java classes accessible to the agent.

Keys

The search key part of the object name of the m-bean instance consists of key attributes and their values used in the object name of the m-bean. Each attribute-value pair is expressed as key=value and must be separated from the one that follows it by a comma. The search key part of an object name is optional.

Other Options

The other options are required only if you do not want to use the defaults.


Note - If you are using the job tool, set the More option to on to add the Java Class and Class Loader text-entry fields to the Create Object window.

Java Class

The Java class name, including the package name, of the m-bean that you want to instantiate or delete. It must be an unquoted text string without spaces. This class must already be installed at a location specified in the CLASSPATH environment variable of the agent. By default, it is the class part of the object name of the m-bean instance.

You only need to specify this option if the agent does not use the default rule for obtaining the Java class of an m-bean from the class part of its object name.


Note - The default rule for obtaining the Java class of an m-bean from its object name is described in "Mapping Rules for Class Names" on page 81.

Class Loader

The object name of the class loader you want to use for loading the class of the m-bean to be instantiated.



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

Previous Next Contents Index