For a monitor class to leverage the intrinsic features of the correlator, it must set up one or more listeners.
A listener is a conceptual entity whose function is to sift through all incoming event streams looking for a particular event or sequence of events. The event or sequence of events of interest is represented as an event expression.
The simplest way of setting up a listener is by creating an instance of an
EventExpression and then specifying a
MatchListener object that gets triggered when the expression becomes true, that is, when a suitable event or event sequence is detected. A more efficient alternative is to use a
prepared event expression, which is described in
Optimizing event types.