Event Handler Registration

Event handlers and their associated (optional) filters have to be registered against a particular event class to be invoked when the an event of the specified class is raised. This is done in file named handler_config.xml placed in the events folder of a Cúram component.

Figure 1. Event handler registration file
<registrations>
    <event-registration handler="curam.impl.SomeEventHandler">
      <event-classes>
        <event-class identifier="CLASS1"/>
      </event-classes>
    </event-registration>
    <event-registration handler="curam.impl.AnotherEventHandler"
                        filter="curam.impl.AnotherEventFilter">
      <event-classes>
        <event-class identifier="CLASS2"/>
      </event-classes>
    </event-registration>
    <event-registration handler="curam.impl.RemovedEventHandler"
                        removed="true">
      <event-classes>
        <event-class identifier="CLASS2"/>
      </event-classes>
    </event-registration>
  </registrations>
registrations
This is the root tag of an event handler registration file under which individual registrations are defined.
event-registration
Specifies an event handler registration.
handler
The fully qualified name of an event handler class (see: Event handlers).
filter
The fully qualified name of an optional event filter class (see: Event filters).
removed
An optional attribute used by components of a higher precedence to disable previously registered event handlers, (see: Rules of Event Handler Merges).
event-classes
This is a list of all the event classes against which the handler is registered.
event-class
A specific event class against which the specified handler is registered. When any event with the specified class is raised the event handler (providing the event filter approves) is invoked.
identifier
This identifies the event that the handler is registered against. This value should corresponds to the value attribute of an event-class element in the event definition files.