Connector components

The adapter is written in Java and consists of three components:

The connector interacts with the XML data handler. For more on data handlers, see the Data Handler Guide.

Figure 1 illustrates the architecture of the connector components. The modular design of the connector enables you to design custom components to replace the product-delivered functionality.

Figure 1. Connector architecture


Connector

The connector passes business objects between the integration broker and a protocol handler. The connector:

The primary methods used by the connector are init(), doVerbFor(), and pollForEvents(). The init() method reads all configuration values from the integration broker's repository, sets proxy names (HTTP and HTTPS) and respective ports, and reads the Java class package names for the protocol handler (JavaProtocolHandlerPkgs) and XML data handler (JavaDataHandlerPkgs), and the value of properties of the data handler and protocol handler.

The doVerbFor() method handles the business object request/response operations. When the connector receives a top-level business object from an integration broker, the doVerbFor() method extracts the request business object and the destination URL. The doVerbFor() method then creates the appropriate protocol handler instance.

When the connector receives a response from the destination URL, the doVerbFor() method populates the response business object as a child of the top-level business object and then returns the result to the integration broker. In the connector, all errors are propagated as exceptions and are handled through the connector, where BON_FAIL is returned and Return Status Descriptor is set.

The pollForEvents() method is used for event notification. The connector has the ability to check for events from a URL by using business objects. For more information on event notification, see "Event notification".

The connector sets a static property to contain the name of the top-level data handler meta-object as it is specified in the DataHandlerConfigMO connector configuration property.

Protocol handler (HTTP and HTTPS)

The protocol handler enables the connector to communicate with a URL by using the HTTP and HTTPS protocols. The protocol handler is an abstract base class that extends the Java URLConnection class. This class contains abstract methods that can be implemented to provide support for specific protocols, such as HTTP and HTTPS. An instance of the protocol handler is created by the Protocol Handler Framework, which is called by the connector.

The WebSphere Business Integration Adapter for XML includes asynchronous and synchronous protocol handlers. Synchronous protocol handlers return business objects from synchronous responses. Asynchronous protocol handlers do not expect a response business object; they return only a success or failure message based on the return code from the post operation. The asynchronous protocol handler does not support event notification.

Note:
By using the Protocol Handler Framework, you can add support for other protocols such as FTP. The Protocol Handler Framework is an abstract base class called CWURLConnection.

The Protocol Handler Framework creates an instance of a protocol handler, and the connector passes a business object to the created instance. The protocol handler extracts the content type (such as text/plain or text/xml) from the business object and uses it to create an instance of the XML data handler.

When the protocol handler calls the createHandler() method, it passes in a content type. The data handler create method passes the content type by replacing the forward slash (/) characters with periods (.) and replacing all non-alphanumeric characters with an underscore (_). Then the create method looks for an attribute in the data handler top-level meta-object that matches the parsed string for the content type. If it does not t find a match, the method builds the class name as com.crossworlds.DataHandlers.modified content_type. 1

The protocol handler performs the following operations:

If your implementation of the connector needs to support additional protocols, you must build a custom protocol handler. For information on how to create a custom protocol handler, see Building a custom protocol handler Footnotes:

1

Copyright IBM Corp. 1997, 2004