beginClassNotification

beginClassNotification(theClass:     Class;
                       transients:   Boolean;
                       eventType:    Integer;
                       responseType: Integer;
                       eventTag:     Integer);

The beginClassNotification method of the Object class registers the receiver to be notified when a nominated event occurs on instances of a class and its subclasses.

The object that invokes the beginClassNotification method is referred to as the subscriber. An object that subscribes to a class notification is notified when the nominated event occurs for any instance of the specified class or its subclasses defined in the schema of the specified class. The class instances that are subscribed to are referred to as notification targets.

For notifications on persistent instances, you can subscribe to the following types of event:

For notifications on transient or shared transient instances, you can only subscribe to user events.

A process that uses the beginClassNotification method to subscribe to user event notifications for transient instances will receive notifications for all shared transient instances and for those non-shared transient instances that it has created (that is, the process will not receive notifications for non-shared transient instances that have been created by other processes).

Non-GUI objects (that is, objects that are not instances of a Window subclass) respond to system notifications by implementing the sysNotification method. GUI objects (instances of a Window subclass) respond to system notifications by implementing their sysNotify event method.

If a form or control has an attached window, a requested user notification is directed to the userNotify event and a requested system notification to the sysNotify event.

The subscription to a notification registered by the beginClassNotification method is terminated by the endClassNotification method. You can also use the endNotificationForSubscriber method to terminate all notifications for a specific subscriber.

If the application will be run in JADE thin client mode, subscribe to notifications and timers with care. When an event occurs, each registered subscriber is notified on the application server. In thin client mode, the first notification or timer that is sent causes a further message to be sent to the presentation client to post a message into the Windows message queue of the client. (This is necessary so that the subsequent execution of the notification logic is synchronized with what is taking place on the presentation client.)

When that Windows message is processed by the presentation client, another message is sent to the application server to initiate the processing of the first 10 queued notifications or timers for that client. If there are more than 10 notifications, these actions are repeated until all queued events are processed.

Notifications and timers could therefore have a considerable impact on network traffic.

For an example of the beginClassNotification method, see "Example of Beginning Notifications", under the Object class beginNotification method.

The beginClassNotification method parameters, described in the following subsections, are summarized in the following table.

Parameter Specifies …
theClass The class for which the notification is to be invoked
transients If the user notification is invoked for events occurring in transient instances
eventType The type of event for which the notification is requested
responseType The frequency with which an event notification is sent
eventTag An integer value that is required for each notification