9.5 CORBA Adaptor

 


9.5.1 Overview

9.5.2 Registering CORBA Adaptor

9.5.3 Authenticating the User While Accessing the Agent Through CORBA Adaptor

9.5.4 Testing the Multi-Protocol agent Through the CORBA Client


 

9.5.1 Overview

 

CORBA

 

CORBA (Common Object Request Broker Architecture) is a distributed object architecture that allows objects to interoperate across networks regardless of the language in which they were written or the platform on which they are deployed. Its design is based on OMG Object Model. The OMG Object Model defines common object semantics for specifying the externally visible characteristics of objects in a standard and implementation-independent way.

 

In this model clients request services from objects (which will also be called servers) through a well-defined interface. This interface is specified in OMG IDL (Interface Definition Language). A client accesses an object by issuing a request to the object. The request is an event, and it carries information including an operation, the object reference of the service provider, and actual parameters (if any).

 

CORBA Adaptor

 

The Multi-Protocol agent has common instrumentation that can be accessed through various protocols such as HTML, HTTP, RMI, CORBA, SNMP, and TL1. AdventNet Agent Toolkit supports CORBA Adaptor. The CORBA Adaptor provides a mechanism for interacting with a management system using CORBA. This adaptor exposes the Multi-Protocol agent information to the management system.

 

This topic discusses adding the CORBA Adaptor to the Multi-Protocol agent and testing the agent through CORBA Adaptor.

 

9.5.2 Registering CORBA Adaptor

 

To access the MBeans registered with the  MBean server of the JMX Agent using CORBA, the agent has to be created with a CORBA Adaptor. For this, you have to register the CORBA Adaptor with the MBean server of the Multi-Protocol agent. The com.adventnet.adaptors.corba.CorbaAdaptor class acts as the CORBA Adaptor. It extends the com.adventnet.adaptors.AbstractAdaptor.

 

This CORBA Adaptor itself is registered with the MBean server as an MBean. Therefore, its configuration parameters can also be viewed and changed through other protocol adaptors. The various methods of registering the CORBA Adaptor are explained in the following sections.

 

9.5.2.1 Using JMX Compiler UI

 

The CORBA Adaptor can be added to the Multi-Protocol agent from the JMX Compiler user interface before generating code for the agent. Follow the steps given below to register the CORBA Adaptor from UI:

Now, when code is generated for  the agent, code required for registering the CORBA Adaptor is also generated in the agent's main file. For more information on creating a Multi-Protocol agent, please refer to the topic "Creating a Simple Agent using JMX Compiler" in the "Buliding Multi-Protocol agent" section.

 

When this code is compiled and the agent is started, the CORBA Adaptor is started at the specified port. The default port is 1050. The agent can be started directly from the JMX Compiler UI or from the command line using the run.bat (for windows)/ run.sh (for Unix) file (present in the <projectdir>/agent/bin).

 

Starting the agent from the command line offers additional flexibility of configuring the port number and enabling authentication using the command line options. The command line option [-cp corba_port] allows you to configure the port number before starting the agent.

 

For more information on command line options, please refer to the section "Starting the Agent" in the topic "Testing the Agent".

 

9.5.2.2 Using API

 

The CORBA Adaptor can also be registered using API calls. For this, the following code has to be added to the registerAdventNetAdaptors() method of the Agent's main file:

      corbaadaptor = new CorbaAdaptor();
      name = "Adaptors:type=CorbaAdaptor";
      corbaadaptor.setPort(corbaPort);
      server.registerMBean(corbaadaptor, new ObjectName(name));

The package com.adventnet.adaptors.corba.CorbaAdaptor must also be imported into the agent's main file. In order to stop the adaptor when the agent is shut down, the following code (shown in bold) has to be added to the shutDownJmxAgent()  method of the agent's main file:

When this code is compiled and the agent is started, the CORBA Adaptor is started at the specified port. The default port is 1050. The setPort(corbaPort) method can be used to change the port at which the adaptor is started.

      Note: In case the port number specified for starting the agent is already occupied, the server creation fails.

9.5.3 Authenticating the User While Accessing the Agent Through CORBA Adaptor

 

The CORBA adaptor exposes the attributes and operations of all the MBeans registered with the MBean server of the Multi-Protocol agent. You may restrict the access to the MBean information. This can be done using the Authentication feature. Here, the user is authenticated based on the user name and password.

 

The Authentication feature of CORBA Adaptor is exposed as a Service MBean. It may be enabled either from the JMX Compiler user interface or by using API calls. Both the methods are explained in Enabling Authentication Support in Multi-Protocol agent.

 

9.5.3.1 Using UI

 

The Authentication feature can be enabled and user entries can also be added from the JMX Compiler user interface. Follow the steps given below to enable Authentication for CORBA Adaptor:

User entries can also be added from the JMX Compiler user interface. The user name and password entries are persisted in a text file.

 

9.5.3.2 Adding User Entries from UI

 

User entries can be added from the JMX Compiler user interface before code generation. If user entries are added after code generation, the code has to be regenerated after adding the new entries. Follow the steps given below to add user entries from the UI:

Any number of user entries can be added using this method.

 

9.5.3.3 Using APIs

 

Authentication feature can also be enabled by using API calls. For this, the following code (shown in bold) has to be added to the agent's main file:

The enableAuthentication(boolean authenticate) method enables authentication feature when the boolean parameter "authenticate" takes the value "true".

 

9.5.4 Testing the Multi-Protocol agent Through the CORBA Client

 

The CORBA Adaptor acts as a server and exposes the Multi-Protocol agent information. Therefore, the CORBA Client can be used to test the Multi-Protocol agent. For this, either of the following can be used:

9.5.4.1 Using MBean Browser

 

The MBean Browser is a UI tool that allows you to test the Multi-Protocol agent using RMI, CORBA, or HTTP protocol. To test the agent using CORBA Adaptor, you have to connect to the agent through the CORBA Adaptor. Once you connect to the agent through the CORBA Adaptor, all MBeans registered with the MBean server of the Multi-Protocol agent are listed.

 

Now,  you can use the MBean Browser to do the following:

Follow the steps given below to connect to the agent through CORBA Adaptor:

In case Authentication is enabled, a dialog is displayed where you have to enter the user name and password. Now, connection is established with the agent through the CORBA Adaptor and all MBeans registered with the MBean server are listed in the left side tree.

 

Viewing MBean Attributes

 

The MBeans registered with the Multi-Protocol agent are grouped according to the Domains and listed under the root domain in the tree. The attributes and the operations of an MBean are listed as nodes.

 

Click the Attributes node. The attributes of the MBean are displayed on the right frame. If the MBean is a scalar, the attributes and their corresponding values are listed on the right frame. In case the MBean is of tabular data type, the table is displayed on the right frame. The index columns are highlighted.

 

Values of attributes having Read-Write access are displayed in editable format. Their values can be changed directly. Enter the new value for the attribute and click Submit  button.

 

New rows can be added to table MBeans using the Add Row button. Select a row in the table and click the Modify Row button or Delete Row button to modify or delete the row. If an attribute's value is of type array, a button is displayed and on clicking the button, all the values are listed in a separate pop-up dialog.

 

In order to view only a few MBeans from the list displayed in the tree, you can use the Filter MBean option. Here, you can filter the MBeans based on the Object name of the MBeans.  Follow the steps given below to filter the MBeans:

    1. Enter the Filter condition at the top of the MBean tree. (The filter condition must resemble the format of the MBean's object name Domain: key=value.)

    2. Click the Requery button at the bottom of the tree.

All MBeans with object names satisfying the filter condition specified are listed in the tree. To view all the MBeans, enter the filter condition as *:*

 

Performing Operations on MBeans

 

To view the operations available for an MBean, click the Operations node for the MBean from the tree. All operations associated with the MBean are displayed as buttons in the right frame. Click the button to perform the operation.

 

If the operation is a GET operation, the value retrieved is displayed in a pop-up dialog. If the operation is a SET operation, the dialog appears with a text field to enter the new value. Specify the value and click OK. This  performs the SET operation. Other operations such as Start service, Stop service, etc.,  are performed when the operation button is clicked.

 

Viewing Notifications Sent by the Agent

 

Notifications are unsolicited messages sent by the agent to the managers when it encounters some critical events. Some of the critical events that trigger  notifications are registering/ de-registering an MBean, performing SET on some MBean attribute (only when the Generate trap on SET option is enabled in the JMX Compiler UI), etc.

 

Some services such as timer service (used to send predefined notifications at specified date and time) and monitor service (used to send notifications when the monitored attribute reaches a threshold value) also trigger notifications depending upon their configurations.

 

Notifications sent by the Multi-Protocol agent can be viewed through the CORBA Adaptor. Follow the steps given below to view notifications using MBean Browser.

All the notifications sent by the agent are displayed in table format containing the following information: Sequence number, Type of Notification, Source from which the notification was received, Time stamp, Notification Message, and additional User data, if any. The Remarks button at the bottom of the table can be used to view detailed information pertaining to a notification.

 

9.5.4.2 Using Client APIs

 

The CORBA Adaptor acts as a server and exposes the agent information. In order to access and manipulate this information, AdventNet Agent Toolkit provides client-side APIs. The CORBA Client APIs can be used by Java Managers to connect to the agent and access its information through the CORBA Adaptor.  These APIs make the task of MBean management easier. They also support remote notifications allowing you to view the notifications sent by the agent.

 

The CorbaClient API is present in the com.adventnet.adaptors.clients.corba package. This class extends the com.adventnet.adaptors.clients.AbstractClient and implements the com.adventnet.adaptors.clients interface. This interface is a common interface to be implemented by all connector clients.

 

This CorbaClient API has methods that allow you to do the following:

Please refer to the javadocs for more information on each method of CorbaClient API. AdventNet MBean Browser is also built using these APIs.

 

The remote notifications can be viewed through the client-side APIs by implementing the NotificationListenerInterface. A client-side application  which implements NotificationListener can register to the MBeans in the MBean Server of the Multi-Protocol agent using the addNotificationListener. This hides the complexity involved in handling remote notifications and allows you to view the notifications.

 

 

Copyright © 1996-2004, AdventNet Inc. All Rights Reserved.