Apama 10.15.5 | Developing Apama Applications | Developing Apama Applications in Java | Overview of Apama JMon Applications | About event listeners and match listeners
 
About event listeners and match listeners
 
Example of a MatchListener
Defining multiple listeners
Removing listeners
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.
A match listener is a Java object that implements the com.apama.jmon.MatchListener interface and implements the match method. This method is called by the correlator when the event expression it is registered with is detected.