|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavassist.expr.ExprEditor
chord.instr.BasicInstrumentor
public class BasicInstrumentor
Basic bytecode instrumentor providing hooks for transforming
classes, methods, and instructions.
Custom instrumentors must extend either this class or class
Instrumentor.
| Field Summary | |
|---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
argsMap
|
protected javassist.CtClass |
currentClass
|
protected javassist.CtBehavior |
currentMethod
|
static java.lang.String |
EVENT_HANDLER_ARGS_KEY
|
static java.lang.String |
EVENT_HANDLER_CLASS_KEY
|
protected java.lang.String |
eventHandlerDoneCall
|
protected java.lang.String |
eventHandlerInitCall
|
static java.lang.String |
INSTRUMENTOR_CLASS_KEY
|
protected boolean |
isMainClass
|
protected JavassistPool |
pool
|
protected java.lang.String[] |
scopeExcludeAry
|
static java.lang.String |
USE_JVMTI_KEY
|
protected boolean |
useJvmti
|
protected int |
verbose
|
| Constructor Summary | |
|---|---|
BasicInstrumentor(java.util.Map<java.lang.String,java.lang.String> argsMap)
Constructor. |
|
| Method Summary | |
|---|---|
void |
edit(javassist.expr.ArrayAccess e)
|
void |
edit(javassist.expr.ConstructorCall e)
|
void |
edit(javassist.CtBehavior method)
Provides a hook to instrument a method specified in Javassist's representation. |
javassist.CtClass |
edit(javassist.CtClass clazz)
Provides a hook to instrument a class specified in Javassist's representation. |
void |
edit(javassist.expr.FieldAccess e)
|
void |
edit(javassist.expr.MethodCall e)
|
void |
edit(javassist.expr.MonitorEnter e)
|
void |
edit(javassist.expr.MonitorExit e)
|
void |
edit(javassist.expr.NewArray e)
|
void |
edit(javassist.expr.NewExpr e)
|
javassist.CtClass |
edit(java.lang.String cName)
Provides a hook to instrument a class specified by name. |
JavassistPool |
getPool()
|
java.lang.String |
insertBefore(int pos)
Provides a hook to insert instrumentation just before the specified bytecode instruction in its containing method. |
boolean |
isExcluded(java.lang.String cName)
|
boolean |
isExplicitlyExcluded(java.lang.String cName)
|
boolean |
isImplicitlyExcluded(java.lang.String cName)
|
| Methods inherited from class javassist.expr.ExprEditor |
|---|
doit, edit, edit, edit |
| 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 INSTRUMENTOR_CLASS_KEY
public static final java.lang.String EVENT_HANDLER_CLASS_KEY
public static final java.lang.String EVENT_HANDLER_ARGS_KEY
public static final java.lang.String USE_JVMTI_KEY
protected int verbose
protected final JavassistPool pool
protected java.lang.String[] scopeExcludeAry
protected java.util.Map<java.lang.String,java.lang.String> argsMap
protected javassist.CtClass currentClass
protected javassist.CtBehavior currentMethod
protected boolean useJvmti
protected boolean isMainClass
protected java.lang.String eventHandlerInitCall
protected java.lang.String eventHandlerDoneCall
| Constructor Detail |
|---|
public BasicInstrumentor(java.util.Map<java.lang.String,java.lang.String> argsMap)
argsMap - Arguments to the instrumentor in the form of a
map of (key, value) pairs.| Method Detail |
|---|
public JavassistPool getPool()
public boolean isExplicitlyExcluded(java.lang.String cName)
public boolean isImplicitlyExcluded(java.lang.String cName)
public boolean isExcluded(java.lang.String cName)
public javassist.CtClass edit(java.lang.String cName)
throws javassist.NotFoundException,
javassist.CannotCompileException
edit(CtClass) method.
cName - Name of the class to be instrumented
(e.g., java.lang.Object).
javassist.NotFoundException - If Javassist fails to find the class.
javassist.CannotCompileException - If Javassist fails to correctly
instrument the class.
public javassist.CtClass edit(javassist.CtClass clazz)
throws javassist.CannotCompileException
clazz - Javassist's representation of the class to be
instrumented.
javassist.CannotCompileException - If Javassist fails to correctly
instrument the class.
public void edit(javassist.CtBehavior method)
throws javassist.CannotCompileException
insertBefore(int)
method for each instruction, ws well as the relevant edit
method for certain kinds of instructions (namely, object
allocation, field access, array access, monitor enter/exit,
and method invocation).
method - Javassist's representation of the method to be
instrumented in the currently instrumented class.
javassist.CannotCompileException - If Javassist fails to correctly
instrument the class.public java.lang.String insertBefore(int pos)
insertBefore in class javassist.expr.ExprEditorpos - Index of a bytecode instruction in the currently
instrumented method.
public void edit(javassist.expr.NewExpr e)
throws javassist.CannotCompileException
edit in class javassist.expr.ExprEditorjavassist.CannotCompileException
public void edit(javassist.expr.NewArray e)
throws javassist.CannotCompileException
edit in class javassist.expr.ExprEditorjavassist.CannotCompileException
public void edit(javassist.expr.FieldAccess e)
throws javassist.CannotCompileException
edit in class javassist.expr.ExprEditorjavassist.CannotCompileException
public void edit(javassist.expr.ArrayAccess e)
throws javassist.CannotCompileException
edit in class javassist.expr.ExprEditorjavassist.CannotCompileException
public void edit(javassist.expr.MonitorEnter e)
throws javassist.CannotCompileException
edit in class javassist.expr.ExprEditorjavassist.CannotCompileException
public void edit(javassist.expr.MonitorExit e)
throws javassist.CannotCompileException
edit in class javassist.expr.ExprEditorjavassist.CannotCompileException
public void edit(javassist.expr.ConstructorCall e)
throws javassist.CannotCompileException
edit in class javassist.expr.ExprEditorjavassist.CannotCompileException
public void edit(javassist.expr.MethodCall e)
throws javassist.CannotCompileException
edit in class javassist.expr.ExprEditorjavassist.CannotCompileException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||