|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectataspectj.AtAspectjComponent
ataspectj.instrumentation.InstrumentationRepository
public class InstrumentationRepository
It store the information relative to an annotated block to be extruded.
Field Summary | |
---|---|
protected atjava.lang.annotation.AnnotatedBlock |
_annotatedBlock
The annotated block to instrument. |
protected byte[] |
_annotatedBytecode
The annotated bytecode. |
protected org.apache.bcel.generic.InstructionList |
_annotatedIl
The annotated instruction list. |
protected java.lang.Class |
_class
The owner class of the annotated block. |
protected org.apache.bcel.generic.ClassGen |
_classGen
The ClassGen associated with the class. |
protected org.apache.bcel.generic.ConstantPoolGen |
_cpgen
The constant pool gen associated with the class. |
protected static java.util.Hashtable<java.lang.String,java.lang.Integer> |
_freeIndex
Hash table used to store for each method wich free index is available. |
protected int |
_freeLocalIndex
It stores the first local index freee. |
protected org.apache.bcel.generic.InstructionList |
_invoke
The invoke instruction list of the new method. |
protected IndexRepository[] |
_irAnnotated
The index repository array to trace all the variables envolved. |
protected org.apache.bcel.classfile.JavaClass |
_javaclass
The JavaClass object of the class. |
protected java.lang.String |
_keyFreeIndexHash
|
protected org.apache.bcel.classfile.Method |
_method
The Bcel version of the object. |
protected org.apache.bcel.generic.MethodGen |
_methodGen
The MethodGen object relative to the method |
protected boolean[] |
_modified
Bit vector to remeber which instruction are already modified. |
protected byte[] |
_newBytecode
The new bytecode modified by the instrumentation process, it will be the final bytecode of the method. |
protected org.apache.bcel.generic.InstructionList |
_newIl
The final instruction list after the change. |
protected java.lang.String |
_newMethodName
The new method name |
protected int |
_numParam
the number of parameter of the new method. |
protected java.lang.reflect.AccessibleObject |
_obj
The AccessibleObject relative to the method or constructor. |
protected org.apache.bcel.generic.InstructionList |
_oldIl
The original Instruction List |
protected byte[] |
_oldMethodBytecode
The original bytecode of the method |
protected static java.lang.String |
METHOD_SUFFIX
The suffix of the new method to be created |
Fields inherited from class ataspectj.AtAspectjComponent |
---|
barrier, CODEPRINT, DEBUG, VERBOSE |
Constructor Summary | |
---|---|
InstrumentationRepository()
The standard constructor of the class. |
|
InstrumentationRepository(java.lang.reflect.AccessibleObject obj,
java.lang.Class clazz,
org.apache.bcel.classfile.JavaClass jclazz,
org.apache.bcel.classfile.Method bcelmethod,
atjava.lang.annotation.AnnotatedBlock annBlock)
The real constructor of the class. |
Method Summary | |
---|---|
org.apache.bcel.classfile.Method |
addNewInvokeInstructionList(org.apache.bcel.generic.MethodGen mg,
int endPc,
org.apache.bcel.generic.InstructionList invokeList,
org.apache.bcel.generic.ConstantPoolGen cg)
It adds the new invoke instruction list to the original method. |
boolean |
compareAnnotatedBlock(atjava.lang.annotation.AnnotatedBlock auxB)
|
int |
compareTo(InstrumentationRepository o)
Compares two InstrumentationRepository object. |
java.lang.reflect.AccessibleObject |
getAccessibleObject()
The getter method for the AccessibleObject field |
atjava.lang.annotation.AnnotatedBlock |
getAnnotatedBlock()
The getter method for AnnotatedBlock object. |
byte[] |
getAnnotatedBytecode()
The getter method for the annotated bytecode. |
org.apache.bcel.generic.InstructionList |
getAnnotatedInstructionList()
The getter method for the annoted instruction list object. |
protected byte[] |
getBytecode(byte[] bc,
int start,
int end)
Retrieves a piece of bytecode. |
org.apache.bcel.generic.ClassGen |
getClassGen()
The getter method for ClassGen object. |
java.lang.Class |
getClassToInstrument()
The getter method for Class object. |
org.apache.bcel.classfile.ConstantPool |
getConstantPool()
The getter method for the constant pool object. |
org.apache.bcel.generic.ConstantPoolGen |
getConstantPoolGen()
The getter method for ConstantPoolGen object. |
int |
getEndPc()
The getter method for the end pc of the annotated block |
java.lang.Integer |
getFreeIndex()
|
IndexRepository[] |
getIndexUsedIntoAnnotation()
The getter method for index repository array. |
org.apache.bcel.classfile.JavaClass |
getJavaClass()
The getter method for the JavaClass object. |
int |
getLocalVariableFirstFreeIndex()
It search the first local variable index free to be used. |
org.apache.bcel.classfile.Method |
getMethod()
The getter method for the bcel Method obejct. |
org.apache.bcel.generic.MethodGen |
getMethodGen()
The getter method for MethodGen object. |
java.lang.String |
getMethodName()
The getter method for the method name |
org.apache.bcel.generic.InstructionList |
getNewMethodInvokeInstructionList(org.apache.bcel.generic.ConstantPoolGen cg)
It Creates the new method invocation instruction list. |
java.lang.String |
getNewMethodName()
The getter method for the new method name. |
byte[] |
getOldMethodBytecode()
The getter method for the original bytecode of the method. |
int |
getStartPc()
The getter method for the start pc of the annotated block |
protected IndexRepository[] |
getUsedIndex(int pc,
org.apache.bcel.generic.Instruction[] il,
org.apache.bcel.classfile.LocalVariableTable lvt)
It checks the instruction list to retrieve the information about the local variables involved. |
boolean |
isStatic()
Check if the method is static. |
protected void |
setIndexWrapperIntoNewMethod(IndexRepository[] irs,
int lastIndexUsed)
It sets the index for the new wrapper object in the new method instruction list. |
protected void |
setNewIndexs(IndexRepository[] irs)
It updates the local variables index for the new non-static method. |
protected void |
setNewIndexsForStatic(IndexRepository[] irs)
It updates the local variables index for the new static method. |
void |
update(java.lang.Class c,
org.apache.bcel.classfile.JavaClass jc,
org.apache.bcel.generic.ClassGen cg,
org.apache.bcel.generic.ConstantPoolGen cpg,
org.apache.bcel.generic.MethodGen mg)
It updates the pricipal field to propagate the changes. |
Methods inherited from class ataspectj.AtAspectjComponent |
---|
done |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.lang.String METHOD_SUFFIX
protected java.lang.Class _class
protected org.apache.bcel.generic.ClassGen _classGen
protected org.apache.bcel.generic.ConstantPoolGen _cpgen
protected org.apache.bcel.classfile.JavaClass _javaclass
protected java.lang.reflect.AccessibleObject _obj
protected org.apache.bcel.classfile.Method _method
protected org.apache.bcel.generic.MethodGen _methodGen
protected atjava.lang.annotation.AnnotatedBlock _annotatedBlock
protected byte[] _annotatedBytecode
protected byte[] _oldMethodBytecode
protected org.apache.bcel.generic.InstructionList _oldIl
protected org.apache.bcel.generic.InstructionList _annotatedIl
protected byte[] _newBytecode
protected org.apache.bcel.generic.InstructionList _newIl
protected boolean[] _modified
protected IndexRepository[] _irAnnotated
protected int _numParam
protected org.apache.bcel.generic.InstructionList _invoke
protected java.lang.String _newMethodName
protected int _freeLocalIndex
protected java.lang.String _keyFreeIndexHash
protected static final java.util.Hashtable<java.lang.String,java.lang.Integer> _freeIndex
Constructor Detail |
---|
public InstrumentationRepository()
public InstrumentationRepository(java.lang.reflect.AccessibleObject obj, java.lang.Class clazz, org.apache.bcel.classfile.JavaClass jclazz, org.apache.bcel.classfile.Method bcelmethod, atjava.lang.annotation.AnnotatedBlock annBlock)
obj
- the AccessibleObjectclazz
- the Class object.jclazz
- the JavaClass object.bcelmethod
- the bcel Mehtod object.annBlock
- the annotatedBlock.Method Detail |
---|
public void update(java.lang.Class c, org.apache.bcel.classfile.JavaClass jc, org.apache.bcel.generic.ClassGen cg, org.apache.bcel.generic.ConstantPoolGen cpg, org.apache.bcel.generic.MethodGen mg) throws java.lang.Exception
c
- the Class object.jc
- The JavaClass object.cg
- The ClassGen object.cpg
- The ConstantPoolGen object.mg
- The MethodGen object.
java.lang.Exception
- if something wrong happnes.public boolean compareAnnotatedBlock(atjava.lang.annotation.AnnotatedBlock auxB)
public java.lang.Integer getFreeIndex()
public int getStartPc()
public int getEndPc()
public java.lang.reflect.AccessibleObject getAccessibleObject()
public atjava.lang.annotation.AnnotatedBlock getAnnotatedBlock()
public org.apache.bcel.classfile.JavaClass getJavaClass()
public java.lang.Class getClassToInstrument()
public IndexRepository[] getIndexUsedIntoAnnotation()
public java.lang.String getMethodName()
public org.apache.bcel.classfile.Method getMethod()
public java.lang.String getNewMethodName()
public org.apache.bcel.generic.InstructionList getAnnotatedInstructionList()
public byte[] getAnnotatedBytecode()
public byte[] getOldMethodBytecode()
public org.apache.bcel.classfile.ConstantPool getConstantPool()
public boolean isStatic()
public org.apache.bcel.generic.ClassGen getClassGen()
public org.apache.bcel.generic.ConstantPoolGen getConstantPoolGen()
public org.apache.bcel.generic.MethodGen getMethodGen()
protected IndexRepository[] getUsedIndex(int pc, org.apache.bcel.generic.Instruction[] il, org.apache.bcel.classfile.LocalVariableTable lvt)
pc
- the start program counteril
- the instruction list to check.lvt
- the local variable table.
public org.apache.bcel.generic.InstructionList getNewMethodInvokeInstructionList(org.apache.bcel.generic.ConstantPoolGen cg)
public org.apache.bcel.classfile.Method addNewInvokeInstructionList(org.apache.bcel.generic.MethodGen mg, int endPc, org.apache.bcel.generic.InstructionList invokeList, org.apache.bcel.generic.ConstantPoolGen cg)
mg
- the method gen object.endPc
- the end pc of the annotated block where we have to add the invoke list.invokeList
- the new invoke list.cg
- the constant pool gen object.public int getLocalVariableFirstFreeIndex()
protected void setNewIndexs(IndexRepository[] irs)
irs
- the indexrepository array.protected void setNewIndexsForStatic(IndexRepository[] irs)
irs
- the indexrepository array.protected void setIndexWrapperIntoNewMethod(IndexRepository[] irs, int lastIndexUsed)
irs
- the index repository array.lastIndexUsed
- the last index used.public int compareTo(InstrumentationRepository o)
compareTo
in interface java.lang.Comparable<InstrumentationRepository>
protected byte[] getBytecode(byte[] bc, int start, int end)
bc
- the total bytecode.start
- the start index.end
- the end index.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |