Developing Apama Applications > Developing Apama Applications in Java > Overview of Apama Java Applications > About event listeners and match listeners
About event listeners and match 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.
This section discusses the following topics:
*Example of a MatchListener
*Defining multiple listeners
*Removing listeners
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.