Interface NotificationHandler


public interface NotificationHandler
In some situations, FTL must notify programs of conditions that preclude the use of event queues (as the communications medium). Instead of sending an advisory, FTL notifies the program through an out-of-band mechanism.

Customer programs implement this interface to process notifications.

Programs create one instance of the notification handler class per realm, and may store closure data in fields of that instance. Programs call Realm.setNotificationHandler to register that instance.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The FTL server administratively disabled this client.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onNotification(int type, String reason)
    Process out-of-band notifications.
  • Field Details

    • CLIENT_DISABLED

      static final int CLIENT_DISABLED
      The FTL server administratively disabled this client.

      The current realm object no longer supports FTL functionality. Nonetheless, the program can still call close or destroy methods on FTL objects in the realm.

      To resume FTL functionality, some programs may first call Realm.close on the disabled realm object, and then create a new realm object by calling FTL.connectToRealmServer.

      Other programs may restart or exit.

      See Also:
  • Method Details

    • onNotification

      void onNotification(int type, String reason)
      Process out-of-band notifications.

      Programs define this callback method to process notifications. When the FTL library notifies the program out of band, it invokes this method in a thread that the library owns. Notications by-pass event queues.

      Parameters:
      type - A notification code, which indicates the type of condition.
      reason - A string describing the reason for the notification.