Runtime components : Core components : Events : Concepts : Events implementation
  
Events implementation
The toolkit provides the notifier interface com.ibm.btt.base.Notifier and a class implementing the interface com.ibm.btt.base.DSENotifier. An object that must send events can either extend the DSENotifier class or implement the notifier interface.
Note All toolkit services are notifiers. You instantiate a notifier to signal an event and manage the handlers registered for that event. When you create a notifier, the system automatically registers it with the event manager in a table that contains the notifier name and the instance (notifiersList attribute). When a handler registers for notification of a specific event, the event manager first searches the current context for the notifier object. You can add the notifier to the operation context by calling the addNotifier context instance method. If the notifier is not there, the event manager then searches the table of registered notifiers. If the event manager finds the notifier in any of these places (which means that it is available locally), it adds that handler to the notifier's list of handlers. When you no longer need the notifier instance in the context, you can remove it by calling the removeNotifier method.
The toolkit also provides the handler interface com.ibm.btt.base.Notifier and a class implementing the interface com.ibm.btt.base.DSENotifier. An object that receives events can either extend the DSEHandler class or implement the handler interface. The handler interface provides the methods to register an instance as a handler for an event signaled by a notifier and to dispatch that event.
Go up to
Concepts