Setting Up Callback Handlers

Use the callback handlers for event notifications.

Use the com.sybase.persistence.CallbackHandler API for event notifications including login for synchronization and replay. If you do not register your own implementation of the com.sybase.persistence.CallbackHandler interface, the generated code will regsiter a new default callback handler.

  1. The generated database class contains a method called registerCallbackHandler. Use this method to install your implementation of CallbackHandler.
    For example:
    SUP101DB.registerCallbackHandler(new MyCallbackHandler());
  2. Each generated MBO class also has the same method to register your implementation of the CallbackHandler for that particular type. For example, if Customer is a generated MBO class, you can use the following code:
    Customer.registerCallbackHandler(new MyCustomerMBOCallbackHandler());