Adding a custom component to an adapter

The Generic Log Adapter can be extended by adding custom components that can be included in the context of an adapter configuration file. Custom components can be added as a new component of the adapter, or can be used to replace an existing component in the adapter.

Prerequisite:
Creating a rule-based adapter
Creating a custom component

Adding a new component to the adapter

To add new component to an adapter:

  1. In the Generic Log Adapter perspective, select the adapter configuration file in the Navigator pane. Right-click and select Open with > Adapter Configuration Editor. The file is opened in the editor.
  2. In the Adapter Configuration Editor window, expand the Adapter > Configuration > Context Instance node.
  3. Right-click on the Context Instance and select Add > Process Unit. A new process unit is created in the Context Instance.
  4. Specify a description for the component in the Description field.
  5. If there are inputs required for your component, add properties to the process unit for each required input. To add a property to the process unit, right-click on the process unit, and select Add property.
  6. For each added property, specify a name and value for the property.
  7. To configure the adapter to use the new process unit, you need to create an associated component in a context. Open the context you want to add the process unit to. To open the default context, select Adapter > Contexts > Context Basic Implementation Context.
  8. Right-click on the context that you want to add the process unit to. For the default context, right-click on Context Basic Implementation Context and select Add > Component. A new component is added to the context.
    Note: The order in which the components appear in the Context define the order in which the components are executed. Ensure that you place the new component in the correct order. You can change the order of the components under the context by dragging and dropping them.
  9. Configure the new component with the following values:
    Name: Name of the new processing unit in the context
    Description: Description of what this component does
    Executable class: The Java class that you created for this component
    Logging level:The level of internal logging the outputter component should use.
    A value of 99 means the outputter will not log any messages.
    A value of 0 means the outputter will log messages of all severities.
    The recommended value is 50 which means that only Critical or Fatal internal outputter errors messages are logged.
    Role: The role of the component should be selected from the drop down list. Refer to the Adapter configuration file structure for information on the different roles. For a role that is not listed, select undeclared.
    UniqueID: Must point to the component defined in the Context Instance in step 3. Use the Browse button to select the correct ID.
  10. Save the adapter configuration file changes.

Replacing an existing component in an adapter

To replace an existing component in an adapter with a custom component:

  1. In the Adapter Configuration Editor window, expand the context where you want to replace a component. To expand the default context, select expand the Adapter > Contexts > Context Basic Context Implementation node.
  2. Click on the component that you want to replace. The component details are shown in the right pane.
  3. Update the Name and Description fields to describe your component.
  4. Update the Executable class with your custom component class name. Below is an example of an outputter component that has been replaced by a custom outputter.
    Context Implementation component outputter is updated with changes for a custom component
  5. If the component you are replacing requires specific properties, open the node Configuration > Context Instance, and select the component that you are replacing.
  6. Add properties as required for your component by selecting Add property. Remove any properties not required for your component configuration by right-clicking on the property and selecting Delete.
  7. Save the adapter configuration file changes.

Related tasks
Creating a log parser

Related references
Adapter Configuration File structure