Event filters

As mentioned previously, an event handler can be configured to have a filter. The purpose of a filter is to decide whether or not the handler needs be notified about the event being raised. To create an event filter one simply needs to implement the interface: curam.util.events.impl.EventFilter which is shown below.

If the accept method returns true the event will be passed on to the event handler (that is the eventRaised method of the associated event handler will be invoked), otherwise the event is ignored.

Figure 1. Event filter interface
package curam.util.events.impl;

  import curam.util.events.struct.Event;
  import curam.util.exception.AppException;
  import curam.util.exception.InformationalException;

  public interface EventFilter {
    boolean accept(Event event)
      throws AppException, InformationalException;
  }