KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ch > ethz > prose > jvmai > jikesrvm > stub_weaver > CodeJoinPointImpl


1 package ch.ethz.prose.jvmai.jikesrvm.stub_weaver;
2
3 import com.ibm.JikesRVM.VM_JVMAI;
4 import java.lang.reflect.Method JavaDoc;
5 import ch.ethz.jvmai.*;
6
7 /**
8  * Concrete implementation of a CodeJoinPoint for the Jikes RVM. The structure
9  * is similar to the JVMDI implementation.
10  *
11  * However, some methods aren't implemented yet since they are not used in the
12  * JUnit tests of PROSE. These methods will throw a RuntimeException.
13  *
14  * @author Johann Gyger
15  */

16 public class CodeJoinPointImpl implements CodeJoinPoint, JoinPointKinds {
17
18     /**
19      * The AOP tag associated with this join point.
20      */

21     public Object JavaDoc aopTag;
22
23     /**
24      * Method ID of the method to which this join point belongs.
25      */

26     public int methodId = -1;
27
28     /**
29      * Thread that came across this join point.
30      */

31     public Thread JavaDoc thread;
32
33     /**
34      * Frame pointer of the method where this join point was encountered.
35      */

36     public int fp = -1;
37
38     public Object JavaDoc getAopTag() {
39         return aopTag;
40     }
41
42     public int getByteCodeIndex() {
43         throw new RuntimeException JavaDoc("TODO CodeJoinPointImpl.getByteCodeIndex");
44     }
45
46     public CodeJoinPoint getEnclosingJoinPoint() {
47         return VM_JVMAI.getInstance().getEnclosingJoinPoint(this);
48     }
49
50     public Method JavaDoc getMethod() {
51         return VM_JVMAI.getInstance().getMethod(this);
52     }
53
54     public Object JavaDoc[] getArgs() {
55         return VM_JVMAI.getInstance().getArgs(this);
56     }
57
58     public String JavaDoc getKind() {
59         return KIND_CODE_JP;
60     }
61
62     public int getMask() {
63         return MASK_CODE_JP;
64     }
65
66     public Signature getSignature() {
67         throw new RuntimeException JavaDoc("TODO CodeJoinPointImpl.getSignature");
68     }
69
70     public JoinPointStaticPart getStaticPart() {
71         throw new RuntimeException JavaDoc("TODO CodeJoinPointImpl.getStaticPart");
72     }
73
74     public Object JavaDoc getTarget() {
75         return VM_JVMAI.getInstance().getTarget(this);
76     }
77
78     public Object JavaDoc getThis() {
79         return VM_JVMAI.getInstance().getTarget(this);
80     }
81
82     public String JavaDoc toLongString() {
83         return toString();
84     }
85
86     public String JavaDoc toShortString() {
87         return toString();
88     }
89
90 }
91
Popular Tags