1 18 19 package alt.jiapi.event; 20 21 import java.lang.reflect.Method ; 22 import alt.jiapi.instrumentor.Hook; 23 24 25 32 class MethodExitHook implements Hook { 33 private Method hookMethod; 34 private Object instance; 35 36 public MethodExitHook(MethodEventProducer mep) { 37 this.instance = mep; 38 Class [] params = new Class [] {Object .class, String .class}; 39 try { 40 this.hookMethod = 41 MethodEventProducer.class.getMethod("methodExited", params); 42 } 43 catch (Exception e) { 44 e.printStackTrace(); 46 throw new RuntimeException (e.toString()); 47 } 48 } 49 50 public Method getHookMethod() { 51 return hookMethod; 52 } 53 54 public Object getInstance() { 55 return instance; 56 } 57 } 58 | Popular Tags |