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