Event Definition Files

Events provide a mechanism for loosely-coupled parts of the Cúram application to communicate information about state changes in the system. When one module in the application raises an event, one or more other modules receive notification of that event having occurred provided they are registered as listeners for that event. To make use of this functionality, some events have to be defined, some application code must raise these events, and some event handlers have to be defined and registered as listeners to such events.

Events are defined in Cúram in XML files, that specify both the event classes and the event types. These files are created with a .evx extension and are placed in the events of a Curam component (e.g. ...EJBServer\components\core\events) from where they are picked up and processed by the build scripts.

There are two types of output generated by the evgen command; .java files (for code constants that make the use of events less error prone) and .dmx files (Cúram database scripts for loading event definitions onto the database). The Java artifacts produced from a merged event files are placed in the /build/svr/events/gen/[package] directory, where [package] is the package attribute specified in the event definition file. The database scripts produced from a merged event files are placed in the /build/svr/events/gen/dmx directory.

Chapter 10 of the Cúram Server Developer's Guide provides a comprehensive description of events and how they may be used in the Cúram application.