|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.softevo.sibrelib.extensions.TraceInstrumentationExtension
org.softevo.ample.sibrelib.extensions.ThreadTracer
public class ThreadTracer
Traces an identifier for the active thread.
Field Summary | |
---|---|
static java.lang.String |
METHODNAME_GETTHREADID
Name for the getThreadId method. |
Fields inherited from class org.softevo.sibrelib.extensions.TraceInstrumentationExtension |
---|
context |
Constructor Summary | |
---|---|
ThreadTracer(org.softevo.sibrelib.InstrumentationContext context)
Create a new instance. |
Method Summary | |
---|---|
boolean |
allowTraceInstrumentation(org.apache.bcel.generic.MethodGen methodGenerator)
Forbids instrumentation of the getThreadId
method (because otherwise an endless loop occurs). |
private org.apache.bcel.generic.MethodGen |
generateGetThreadIdMethod(org.apache.bcel.classfile.JavaClass javaClass,
org.apache.bcel.generic.ClassGen classGenerator,
org.apache.bcel.generic.ConstantPoolGen constantPoolGenerator,
org.apache.bcel.generic.InstructionFactory factory)
Generates a static method that determines a thread id for the active thread. |
void |
preProcessJavaClass(org.apache.bcel.classfile.JavaClass javaClass,
org.apache.bcel.generic.ClassGen classGenerator,
org.apache.bcel.generic.ConstantPoolGen constantPoolGenerator,
org.apache.bcel.generic.InstructionFactory factory)
This method simply adds a static method that determines an id for the active thread to every class whose super class is not instrumented. |
Methods inherited from class org.softevo.sibrelib.extensions.TraceInstrumentationExtension |
---|
createMethodStartCode, finishInstrumentation, postProcessJavaClass, verifyInstrumentation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String METHODNAME_GETTHREADID
getThreadId
method.
Constructor Detail |
---|
public ThreadTracer(org.softevo.sibrelib.InstrumentationContext context)
context
- the instrumentation contextMethod Detail |
---|
public void preProcessJavaClass(org.apache.bcel.classfile.JavaClass javaClass, org.apache.bcel.generic.ClassGen classGenerator, org.apache.bcel.generic.ConstantPoolGen constantPoolGenerator, org.apache.bcel.generic.InstructionFactory factory)
preProcessJavaClass
in class org.softevo.sibrelib.extensions.TraceInstrumentationExtension
javaClass
- the class to processclassGenerator
- the generator for the new classconstantPoolGenerator
- the generator for the new constant poolfactory
- the factory for instructionspublic boolean allowTraceInstrumentation(org.apache.bcel.generic.MethodGen methodGenerator)
getThreadId
method (because otherwise an endless loop occurs).
allowTraceInstrumentation
in class org.softevo.sibrelib.extensions.TraceInstrumentationExtension
methodGenerator
- the generator for the method
true
if the method should be instrumentated
with trace code,
false
otherwiseprivate org.apache.bcel.generic.MethodGen generateGetThreadIdMethod(org.apache.bcel.classfile.JavaClass javaClass, org.apache.bcel.generic.ClassGen classGenerator, org.apache.bcel.generic.ConstantPoolGen constantPoolGenerator, org.apache.bcel.generic.InstructionFactory factory)
javaClass
- the class to processmethodGenerator
- the generator for the methodconstantPoolGenerator
- the generator for the new constant poolfactory
- the factory for instructions
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |