beginClassesNotification

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

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

The object that invokes the beginClassesNotification method is referred to as the subscriber.

The beginClassesNotification method does not attempt to re-interpret the value of the theClass parameter, so that the call does not look for a subschema copy class in the current schema with which to register this call and it optionally allows only the class without any of its subclasses to be registered for the notification. For example, a beginClassNotification(MemberKeyDictionary, false, Any_System_Event, Response_Continuous, 1) call looks for a subschema copy class in the current schema to register, and a beginClassesNotification(MemberKeyDictionary, false, false, Any_System_Event, Response_Continuous, 1) call registers the root MemberKeyDictionary class in the RootSchema.

If you want to specify your MemberKeyDictionary subschema copy class and allow both the class and its subclasses to be registered for the notification, call beginClassesNotification as follows.

beginClassesNotification(currentSchema.getClass('MemberKeyDictionary'),
                     true, false, Any_System_Event, Response_Continuous, 1);

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 (when the includeSubclasses parameter is set to true). 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 instances, you can only subscribe to user events.

A process that uses the beginClassesNotification 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 beginClassesNotification method is terminated by the endClassesNotification 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.

The beginClassesNotification 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
includeSubclasses Whether subclasses are included in or excluded from the notification registration
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