Developing Apama Applications > Developing Apama Applications in Java > Developing and Deploying Java Applications > Creating deployment descriptor files > Sample source files with annotations
Sample source files with annotations
Following are two sample source files with annotations. These are the source files for the simple sample application provided with Apama. The lines with the annotations are in bold typeface for your convenience.
Here is the Simple.java file with comments removed:
import com.apama.jmon.*;
import com.apama.jmon.annotation.*;
 
@Application(name = "Simple",
    author = "Moray Grieve",
    version = "1.0",
    company = "Apama",
    description = "Deployment descriptor for the Simple java monitor")
 
@MonitorType(description = "A simple java monitor, used to show
    functionality of a new installation.")
public class Simple implements Monitor, MatchListener {
 
   public Simple() {}
 
   public void onLoad() {
     EventExpression eventExpr = new EventExpression(
         "all Tick(*, >10.0):t");
     eventExpr.addMatchListener(this);
   }
   public void match(MatchEvent event) {
     Tick tick = (Tick)event.getMatchingEvents().get("t");
     tick.emit();
   }
}
Here is the Tick.java file with comments removed:
import com.apama.jmon.Event;
import com.apama.jmon.annotation.*;
 
@EventType(description = "Event which signals a stock trade")
public class Tick extends Event {
 
  public String name;
  public double price;
  public Tick() {
    this("", 0);
  }
 
  public Tick(String name, double price){
     this.name = name;
     this.price = price;
   }
}
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.