1 22 package org.jboss.aop.instrument; 23 24 import javassist.CannotCompileException; 25 import javassist.CtClass; 26 import javassist.NotFoundException; 27 28 34 public class ClassicCallerInfoAdder extends CallerInfoAdder 35 { 36 37 public ClassicCallerInfoAdder(Instrumentor instrumentor) 38 { 39 super(instrumentor); 40 } 41 42 protected void addMethodByMethodInfoField(CtClass addTo, String fieldName, long callingHash, String classname, long calledHash) throws NotFoundException, CannotCompileException 43 { 44 String init = "aop$classAdvisor$aop.resolveCallerMethodInfoAsWeakReference(" + callingHash + "L, \"" + classname + "\", " + calledHash + "L)"; 45 addMethodByMethodInfoField(addTo, fieldName, init); 46 } 47 48 protected void addConByMethodInfoField(CtClass addTo, String fieldName, long callingHash, String classname, long calledHash) throws NotFoundException, CannotCompileException 49 { 50 String init = "aop$classAdvisor$aop.resolveCallerConstructorInfoAsWeakReference(" + callingHash + "L, \"" + classname + "\", " + calledHash + "L)"; 51 addConByMethodInfoField(addTo, fieldName, init); 52 } 53 54 protected void addConByConInfoField(CtClass addTo, String fieldName, int callingIndex, String classname, long calledHash) throws NotFoundException, CannotCompileException 55 { 56 String init = "aop$classAdvisor$aop.resolveConstructorCallerConstructorInfoAsWeakReference(" + callingIndex + ", \"" + classname + "\", " + calledHash + "L)"; 57 addConByConInfoField(addTo, fieldName, init); 58 } 59 60 protected void addMethodByConInfoField(CtClass addTo, String fieldName, int callingIndex, String classname, long calledHash) throws NotFoundException, CannotCompileException 61 { 62 String init = "aop$classAdvisor$aop.resolveConstructorCallerMethodInfoAsWeakReference(" + callingIndex + ", \"" + classname + "\", " + calledHash + "L)"; 63 addMethodByConInfoField(addTo, fieldName, init); 64 } 65 66 protected boolean addInfoAsWeakReference() 67 { 68 return true; 69 } 70 } 71 | Popular Tags |