1 package ch.ethz.prose.jvmai.jikesrvm.advice_weaver; 2 3 import java.lang.reflect.Method ; 4 5 import ch.ethz.jvmai.*; 6 7 import com.ibm.JikesRVM.classloader.VM_FieldReference; 8 import com.ibm.JikesRVM.classloader.VM_Method; 9 10 19 public class CodeJoinPointImpl implements CodeJoinPoint, JoinPointKinds { 20 21 24 protected int methodId; 25 26 29 protected Method method; 30 31 34 protected Object aopTag; 35 36 39 protected Object this0; 40 41 44 protected Object args[]; 45 46 55 public void init(int id, Object tag, Object this0, Object [] args) { 56 methodId = id; 57 method = null; 58 aopTag = tag; 59 this.this0 = this0; 60 this.args = args; 61 } 62 63 public Object getAopTag() { 64 return aopTag; 65 } 66 67 public int getByteCodeIndex() { 68 throw new RuntimeException ("Not implemented: " + getClass().getName() + ".getByteCodeIndex()"); 69 } 70 71 public CodeJoinPoint getEnclosingJoinPoint() { 72 throw new RuntimeException ("Not implemented: " + getClass().getName() + ".getEnclosingJoinPoint()"); 73 } 74 75 public Method getMethod() { 76 if (method == null) { 77 VM_Method m = VM_FieldReference.getMemberRef(methodId).asMethodReference().resolve(); 78 method = java.lang.reflect.JikesRVMSupport.createMethod(m); 79 } 80 81 return method; 82 } 83 84 public Object [] getArgs() { 85 return args; 86 } 87 88 public String getKind() { 89 return KIND_CODE_JP; 90 } 91 92 public int getMask() { 93 return MASK_CODE_JP; 94 } 95 96 public Signature getSignature() { 97 throw new RuntimeException ("Not implemented: " + getClass().getName() + ".getSignature()"); 98 } 99 100 public JoinPointStaticPart getStaticPart() { 101 throw new RuntimeException ("Not implemented: " + getClass().getName() + ".getStaticPart()"); 102 } 103 104 public Object getTarget() { 105 return this0; 106 } 107 108 public Object getThis() { 109 return this0; 110 } 111 112 public String toLongString() { 113 return toString(); 114 } 115 116 public String toShortString() { 117 return toString(); 118 } 119 120 } 121 | Popular Tags |