Developing Apama Applications > Developing Apama Applications in EPL > Defining Monitors
Defining Monitors
A monitor is the basic unit of EPL program execution. Monitors have both data and logic. Monitors communicate by sending and receiving events. You define a monitor in a .mon source file. When you load the .mon file into the correlator, the correlator creates an instance of the defined monitor.
A monitor instance can operate like a factory and spawn additional monitor instances. A spawned monitor instance is a duplicate of the monitor instance that spawned it except that the correlator does not clone any active listeners or stream queries. Spawning lets a single monitor instance generate multiple instances of itself. While generally, the spawned monitor instances all listen for the same event type, each one can listen for events that have different values in particular fields.
It is good practice to define monitors and events in separate files. When you inject files into the correlator, be sure to load event type definitons before you load the monitors that process events of those types.
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.