beginNotification(theObj: Object; eventType: Integer; responseType: Integer; eventTag: Integer);
The beginNotification method of the Object class registers the receiver to be notified when a nominated event occurs on a specified object.
The object that invokes the beginNotification method is referred to as the subscriber.
An object that subscribes to a notification is notified when the specified event occurs for the notification target. If a form or control has an attached window, a requested user notification is directed to the
Non-GUI objects respond to system and user notifications by implementing the sysNotification and userNotification methods, respectively. GUI objects (instances of a
System events, which include object creation, deletion, or change. System events are notified automatically by the system when the nominated persistent objects are committed (using the
Each of the target objects is automatically resynchronized in the client cache.
User events, which are specified by selecting an eventType parameter in the range User_Base_Event through User_Max_Event. User events are notified when the causeEvent, sdeCauseEvent, or sdsCauseEvent method of the Object class or the
For notifications on a transient or shared transient instance, you can subscribe to user events only.
The request for a notification registered by the beginNotification method is terminated by the endNotification method. You can also use the endNotificationForSubscriber method to terminate all previous notifications for a specified 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.
Non-immediate events caused on transient objects are not discarded when a persistent transaction is aborted. For example, if the receiver of a causeEvent is a shared transient instance, any notifications are held when the transaction is aborted and delivered when the next transaction commits.
For an example of the beginNotification method, see "Example of Beginning Notifications", later in this topic.
The beginNotification method parameters, described in the following subsections, are summarized in the following table.
Parameter | Specifies … |
---|---|
theObj | The object for which the notification is to be invoked |
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 used to identify a notification subscription that will be passed back to the notification method |