1 package org.sourceforge.jemm.client.events; 2 3 import org.sourceforge.jemm.client.Descriptor; 4 5 /** 6 * Maintains status of method entry and exit. 7 * 8 * @author Paul Keeble 9 * 10 */ 11 public interface StackTracer { 12 13 /** 14 * Marks an method entered and tracks appropriately the current 15 * thread as entering the method on the entity. 16 * 17 * Calls listener.methodEntered, and if this is the first thread 18 * into the Object calls entityEntered first. 19 * 20 * @param entity The object entered 21 * @param method The method by which it was entered 22 */ 23 void enterMethod(Object entity, Descriptor method); 24 25 /** 26 * Determines if the current thread is currently in the entity and method. 27 * 28 * @param entity The object 29 * @param method The method on the object 30 * @return true if the thread has previously be entered, false otherwise 31 */ 32 boolean isMethodEntered(Object entity, Descriptor method); 33 34 /** 35 * Determines if any thread has entered the entity. 36 * 37 * @param entity The object to check 38 * @return True if the entity has been entered, false otherwise 39 */ 40 boolean isEntityEntered(Object entity); 41 42 /** 43 * Exits a method, removing any contexts that have been created. 44 * 45 * Calls the listener.methodExit and if this is the last exit of 46 * all threads also calls entityExited 47 * 48 * @param entity The object being exited 49 * @param method The method from which the thread is exiting 50 */ 51 void exitMethod(Object entity, Descriptor method); 52 53 }