Developing Apama Applications > Developing Apama Applications in EPL > Defining Event Listeners
Defining Event Listeners
An on statement specifies an event expression and a listener action. When the correlator executes an on statement it creates an event listener. An event listener observes each event processed by the correlator until an event or a pattern of events matches the pattern specified in the event listener’s event expression. When this happens the event listener triggers, causing the correlator to execute the listener action. At this point, depending on the form of the event expression, the event listener either terminates or continues listening for additional matching event patterns.
An event listener analyzes the event stream until one of the following happens:
*The event listener finds the pattern defined in its event expression.
*The quit() method is called on the event listener to kill it.
*The monitor that defines the event listener dies.
*The correlator determines that the event listener can never trigger.
The correlator can support large numbers of concurrent event listeners each watching for an individual pattern.
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.