76 WebSphere Business Integration Adapters
6.8.1 Creating the class for the custom business object handler
To create a custom business object handler, you must create a class that
implements the CWCustomBOHandler interface. The CWCustomBOHandler
interface provides the doVerbForCustom() method, which you must implement to
define a custom business object handler. To create a custom business object
handler class for a Java connector:
1. Create a class that implements the CWCustomBOHandler interface.
2. Implement the doVerbForCustom() method to define the behavior of the
business object handler.
6.8.2 Implementing the doVerbForCustom() method
The doVerbForCustom() method provides the functionality for the custom
business object handler. The Adapter Framework calls the low-level doVerbFor()
method (defined in the BOHandlerBase class) for the appropriate business
object handler when it receives a request business object. This low-level
doVerbFor() method determines which business object handler to call as follows:
If the business object’s verb has the CBOH tag in its application-specific
information, it calls the doVerbForCustom() method.
The CBOH tag specifies the full name (including the package name) of the
custom business object handler class, which implements the
CWCustomBOHandlerInterface interface and its doVerbForCustom() method.
If the CBOH tag exists, the low-level doVerbFor() method tries to create a new
instance of the class that this tag specifies. If this instantiation is successful,
the low-level doVerbFor() method calls the doVerbForCustom() method in this
class.
Otherwise, it calls the doVerbFor() method, which the connector developer
must implement as part of the business object handler’s
CWConnectorBOHandler class.
The implementation of the doVerbForCustom() method must handle the verb
processing of the verb for which its class is specified. In this method, you must
customize the behavior of the doVerbForCustom() method to meet the special
processing needs of your business object’s verb.
Note: Unlike the doVerbFor() method, the doVerbForCustom() method is not
invoked directly by the Adapter Framework. Instead, the Adapter Framework
invokes the low-level doVerbFor() method, which in turn, invokes the
doVerbForCustom() method. Therefore, the doVerbForCustom() method
cannot include calls to any methods in the CWConnectorBOHandler class.