causeEvent

causeEvent(eventType: Integer;
           immediate: Boolean;
           userInfo:  Any);

The causeEvent method of the Object class triggers a user event. Any objects that have registered a beginNotification for that object or its class receive a corresponding event message.

A process that uses the causeEvent method to cause notifications for transient instances will cause system event and user event notifications only for shared transient instances and for non-shared transient instances that it has created (that is, the process will not cause notifications for non-shared transient instances that have been created by other processes).

The parameters for the causeEvent method are listed in the following table.

Parameter Description
eventType Integer in the range User_Base_Event through User_Max_Event that represents the event being caused.
immediate Boolean value specifying the timing of the event; false indicates that notifications occur at the end of transaction and true indicates that the notification is sent immediately. If the client is not within a begin/commit transaction cycle and this parameter is set to false, the notification waits for the next commit on that client.
userInfo A value of any primitive type value (for example, a String or an Integer) or object reference that is passed to the userNotify event handlers when the event is notified. Although you should not use a transient object reference across nodes, you can use a shared transient object reference between applications on the same node.
  Notifications containing binary and string (Binary, String, StringUtf8) data of up to 48K bytes can be sent across the network. For applications running within the server node, the limit for notifications containing binary or string data is 2G bytes. Note, however, that this applies only to single user and server applications. In multiuser applications, persistent notifications are sent via the database server, even if the receiving process is on the same node as the sender. In notification cause events, exception 1267 (Notification info object too big) is raised if the binary or string userInfo data exceeds the applicable value.

The following table lists the UserEvents category global constants for notification events.

Global Constant Integer Value
User_Base_Event 16
User_Max_Event Max_Integer (#7FFFFFFF, equates to 2147483647)

You can define your own constants to represent event types in the range User_Base_Event through Max_Integer.

In a Synchronized Database Environment (SDE), when the AuditCauseEvents parameter in the [SyncDbService] section of the JADE initialization file is set to true, events caused on a primary database using Object class :causeEvent method with a persistent target and the immediate parameter value of false outside of a database transaction are not audited for replay on secondary databases because the events are not part of a transaction.