1 22 package org.jboss.aop; 23 24 import java.lang.reflect.Constructor ; 25 import java.lang.reflect.Method ; 26 27 import org.jboss.aop.advice.Interceptor; 28 import org.jboss.aop.joinpoint.ConstructorCalledByConstructorJoinpoint; 29 import org.jboss.aop.joinpoint.Joinpoint; 30 31 36 public class ConByConInfo extends CallerConstructorInfo 37 { 38 private final int callingIndex; 39 private final Constructor calling; 40 41 public ConByConInfo(Advisor advisor, Class calledClass, int callingIndex, Constructor called, long calledConHash, Method wrappingMethod, Interceptor[] in) 42 { 43 super(advisor, calledClass, called, calledConHash, wrappingMethod, in, advisor.getClazz()); 44 this.callingIndex = callingIndex; 45 this.calling = advisor.constructors[callingIndex]; 46 } 47 48 51 private ConByConInfo(ConByConInfo other) 52 { 53 super(other); 54 this.callingIndex = other.callingIndex; 55 this.calling = other.getCalling(); 56 } 57 58 protected Joinpoint internalGetJoinpoint() 59 { 60 return new ConstructorCalledByConstructorJoinpoint(getCalling(), getConstructor()); 61 } 62 63 public JoinPointInfo copy() 64 { 65 return new ConByConInfo(this); 66 } 67 68 public String toString() 69 { 70 StringBuffer sb = new StringBuffer ("Constructor called by Constructor"); 71 sb.append("["); 72 sb.append("calling=" + getCalling()); 73 sb.append(",called=" + getConstructor()); 74 sb.append("]"); 75 return sb.toString(); 76 } 77 78 public int getCallingIndex() 79 { 80 return callingIndex; 81 } 82 83 public Constructor getCalling() 84 { 85 return calling; 86 } 87 } 88 | Popular Tags |