68 Problem Determination Using Self-Managing Autonomic Technology
3.6 Generating Common Base Events
The Autonomic Computing Toolkit provides two ways to generate Common Base
Events. The first is using the Common Base Event APIs provided in the
org.eclipse.hyades.logging.event.cbe package. This Java package is located in
the hlcbe101.jar file and is available from the Eclipse Web site at:
It is also shipped with the Autonomic Computing Toolkit as part of the Generic
Log Adapter component.
The second way is by using the Generic Log Adapter that is suitable for existing
applications that already generate text-based log files.
Generating Common Base Events using APIs
In some cases, we want to generate Common Base Events directly. For example,
if we are writing our new application to provide the application’s tracing as
Common Base Events, we might also want an application to generate Common
Base Events and send them directly to a resource manager or log them into a
file. To accomplish this, there are APIs provided to generate and configure a
Common Base Event object that we can use for each event we need to report
(see Figure 3-2).
Figure 3-2 Generating Common Base Events directly from the application
The Common Base Event API provides the CommonBaseEvent class that
implements the interface called ICommonBaseEvent. The interface
ICommonBaseEvent is part of the package org.eclipse.hyades.logging.core. This
package is provided by the Eclipse project at:
It is also provided by the Autonomic Computing Toolkit in the Generic Log
Adapter component and can be found in the <GLA_inst_dir>\lib\hlcore.jar file,
where <GLA_inst_dir> is the Generic Log Adapter component installation
Chapter 3. Common Base Events 69
The process for generating Common Base Events can be summarized by the
1. Create an event factory.
2. Create an empty Common Base Event.
3. Define the source component.
4. Define the reporter component.
5. Define the situation data.
6. Obtain the creation time.
7. Define additional information for the event as needed.
See 3.7, “Generating Common Base Events using APIs” on page 70 for more
details about each of these steps.
Generating Common Base Events using GLA
Currently, most enterprise applications provide log files for tracing the application
behavior. The Generic Log Adapter (GLA) provides a way to convert existing log
files into the Common Base Event format (see Figure 3-3). The GLA engine
takes an adapter file and the log file as inputs and converts the entries in the log
file to Common Base Events. The adapter configuration file describes the
conversion rules from the log file to the Common Base Event fields. The
Autonomic Computing Toolkit provides a plug-in to Eclipse for writing and editing
adapter configuration files that specifically generate the output in a Common
Base Event format and testing the adapter configuration file before deploying it.
Figure 3-3 Using the Generic Log Adapter to generate Common Base Events
Chapter 4, “Generic Log Adapter” on page 77 describes how to generate
Common Base Events using the Generic Log Adapter in more detail.