Extending the Java connector base class

In the Java connector library, the connector base class is named CWConnectorAgent. The CWConnectorAgent class provides methods for startup, subscription checking, business object subscription delivery, and shut down. To implement your own connector, you extend this connector base class to create your own connector class.

Note:
For general information about the methods of the connector base class, see "Extending the connector base class".

To derive a connector class for a Java connector, follow these steps:

  1. Create a connector class that extends the CWConnectorAgent class. Name this connector class:
    	connectorNameAgent.java
     

    where connectorName uniquely identifies the application or technology with which the connector communicates. For example, to create a connector for a Baan application, you create a connector class called BaanAgent.

  2. In the connector-class file, define a package name to contain your connector. A connector package name has the following format:
    com.crossworlds.connectors.connectorName
     

    where connectorName is the same as defined in step 1 above. For example, the package name for the Baan connector would be defined in the connector-class file as follows:

    package com.crossworlds.connectors.Baan;
     
  3. Ensure that the connector-class file imports the following classes:
    	com.crossworlds.cwconnectorapi.*;
     	com.crossworlds.cwconnectorapi.exceptions.*;
     

    If you create several files to hold the connector-class code, you must import these classes into every connector file.

  4. Implement the appropriate base-class methods for the connector's application-specific component. For more information on how to create these base-class methods, see Table 59.

    Table 59. Extending base-class methods of the CWConnectorAgent class

    CWConnectorAgent method Description For more information
    agentInit() Initializes the application-specific component of the connector. "Initializing the connector"
    getVersion() Obtain the version of the connector. "Checking the connector version"
    getConnectorBOHandlerForBO() Obtain the business-object handler for the business objects. "Obtaining the Java business object handler"
    getEventStore() Obtain the event-store object for the connector. CWConnectorEventStoreFactory interface
    doVerbFor() Process the request business object by performing its verb operation. "Creating a business object handler"
    pollForEvents() Poll event store to obtain application events and send them to the connector framework. "Implementing an event-notification mechanism"
    terminate() Perform cleanup operations for the connector shut down. "Shutting down the connector"

Copyright IBM Corp. 1997, 2003