![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
Before implementing the adapter, you must be clear about the problem to be solved. This section illustrates how an example problem statement can be mapped to a design.The ZapAdapter application retrieves data from a ZAP source application and publishes it to the messaging system. ZAP has the following characteristics:
• ZAP is an enterprise order processing application.
•
• ZAP does not provide event-driven APIs.Because the ZAP system’s data access API does not support an event-driven approach to retrieving data from the ZAP system, ZapAdapter checks every n seconds for new events. If there are unprocessed events, the data associated with the events must be published.Figure 25 shows how this example fits into the TIBCO messaging application framework.
• The adapter sends the data to a listening adapter. The database, which is always kept current by the actions of ZAP adapter, is used for queries. This design offloads query processing from the ZAP instance.
•
• TIBCO ActiveMatrix BusinessWorks could be set up to perform data conversion. This allows users of the database to work with queries they are familiar with.The implementation of ZapAdapter must provide the following elements:
• Initialization and startup. In the example, the adapter needs to:
− Establish a connection with the ZAP instance.
• Event sources. The application must include the following event source:
• Publisher. Publishes the data retrieved by the timer event source.
• Event listener subclass with onEvent() methods.
• Data conversion element. In the ZAP example, data conversion is done explicitly by a ZapEventListener, DataMapper (in C++ only) and ZAPAppData class. The ZapEventListener class accepts data from the ZAP instance and converts it to MInstance format. Specifically, this example retrieves two tables, Customer and Contract that share an ID field.
• Configuration. The configuration is performed in TIBCO Designer. See Specifying Configuration Information.This section gives an overview of the ZapAdapter files and their content.
Table 39 ZapAdapter Files External library used by the ZAP adapter to retrieve and update data. MApp subclass with onInitialization() and onTermination() method. Creates an event handler and publisher instances. Top-level control function main(). Maintains ZAP connectivity logic. Connection parameters are passed through the properties object. This class creates and maintains the handle to the ZAP instance.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |