1 package test; 2 3 import alt.jiapi.event.MethodEventProducer; 4 import alt.jiapi.event.MethodListener; 5 import alt.jiapi.event.MethodEvent; 6 import alt.jiapi.*; 7 8 13 public class EventTest extends InstrumentorTest implements MethodListener { 14 public static void main(String [] args) throws Exception { 15 EventTest et = new EventTest(); 16 et.run(args); 17 } 18 19 public EventTest() throws JiapiException { 20 InstrumentationDescriptor id = new InstrumentationDescriptor(); 21 ctx.addInstrumentationDescriptor(id); 22 23 addInclusionRules(id, getInclusionRules()); 24 addExclusionRules(id, getExclusionRules()); 25 26 MethodEventProducer mep = 27 new MethodEventProducer(id, System.getProperty("resolution", "*")); 28 29 32 mep.addMethodListener(this); 33 } 34 35 public void methodEntered (MethodEvent event) { 37 System.out.println("Method entered : " + event); 38 } 39 40 public void methodExited (MethodEvent event) { 41 System.out.println("Method exited : " + event); 42 } 43 } 44 | Popular Tags |