Creating data-handler meta-objects

If you write a custom data handler that uses data-handler meta-objects, you must:

Note:
For information on how to determine whether to use meta-objects in the data-handler design, see Using data-handler meta-objects.

Creating the child meta-object

The child meta-object contains the configuration information for the data handler. The createHandler() method uses this information to initialize the newly instantiated data handler. For more detailed information on this process, see Using a MIME type.

To create a child meta-object for a custom data handler:

  1. Create a child meta-object to represent an instance of the data handler.

    You can use the Business Object Designer tool to create this child meta-object. The meta-object must contain attributes to define the configuration information that your data handler requires. At a minimum, the child meta-object must have a ClassName attribute.

  2. Determine whether you need to specify the name of the data handler class in the ClassName attribute.
  3. Set the default values of the appropriate attributes in the child meta-object to configure how the data handler instance will process data.

Modifying the top-level meta-object

When a caller supplies a MIME type to the createHandler() method, createHandler() determines which data handler to instantiate with these steps:

  1. Locate the name of the top-level meta-object that is associated with the data handler.
  2. Look in this top-level meta-object for a MIME type that matches the data to convert.
  3. If this MIME type exists, find the name of the associated child meta-object, which contains the configuration information.

For a more detailed explanation of this process, see Using a MIME type. For this process to be successful, createHandler() must be able to locate the MIME type associated with data. Therefore, you must edit the top-level data-handler meta-object to include an attribute for the MIME type of the data that your data handler converts. This attribute must include:

As an example, Figure 43 shows a top-level connector meta-object that is configured for a custom HTML data handler.

Figure 43. Example top-level connector meta-object for a custom data handler


In Figure 43, the default top-level meta-object for a connector (MO_DataHandler_Default) has been modified to support a new MIME type: HTML. In support of this MIME type, the MO_DataHandler_Default meta-object contains the following attribute properties:

Attribute Name = text_html
Attribute Type = MO_DataHandler_HTMLConfig 

Important:
The name of the MIME type is limited to alphanumeric characters and underscores (_). No other special characters can be used for the MIME type.

Setting up meta-objects in the business integration system

Once you have created the data-handler meta-objects, you must set up these meta-objects in the WebSphere business integration system, as follows:

  1. Load the new meta-objects into the repository.
  2. Modify the appropriate meta-object depending on the context in which the data handler will be called:

Copyright IBM Corp. 1997, 2004