chord.program
Class LoadedClassesInstrumentor

java.lang.Object
  extended by javassist.expr.ExprEditor
      extended by chord.instr.BasicInstrumentor
          extended by chord.program.LoadedClassesInstrumentor

public class LoadedClassesInstrumentor
extends BasicInstrumentor

Bytecode instrumentor for determining all loaded classes.

Author:
Mayur Naik (mhn@cs.stanford.edu)

Field Summary
 
Fields inherited from class chord.instr.BasicInstrumentor
argsMap, currentClass, currentMethod, EVENT_HANDLER_ARGS_KEY, EVENT_HANDLER_CLASS_KEY, eventHandlerDoneCall, eventHandlerInitCall, INSTRUMENTOR_CLASS_KEY, isMainClass, pool, scopeExcludeAry, USE_JVMTI_KEY, useJvmti, verbose
 
Constructor Summary
LoadedClassesInstrumentor(java.util.Map<java.lang.String,java.lang.String> argsMap)
           
 
Method Summary
 javassist.CtClass edit(javassist.CtClass clazz)
          Provides a hook to instrument a class specified in Javassist's representation.
 javassist.CtClass edit(java.lang.String cName)
          Provides a hook to instrument a class specified by name.
 
Methods inherited from class chord.instr.BasicInstrumentor
edit, edit, edit, edit, edit, edit, edit, edit, edit, getPool, insertBefore, isExcluded, isExplicitlyExcluded, isImplicitlyExcluded
 
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
 

Constructor Detail

LoadedClassesInstrumentor

public LoadedClassesInstrumentor(java.util.Map<java.lang.String,java.lang.String> argsMap)
Method Detail

edit

public javassist.CtClass edit(java.lang.String cName)
                       throws javassist.NotFoundException,
                              javassist.CannotCompileException
Description copied from class: BasicInstrumentor
Provides a hook to instrument a class specified by name. The default implementation excludes instrumenting classes that are excluded implicitly or explicitly; for each class that is not excluded, it calls the BasicInstrumentor.edit(CtClass) method.

Overrides:
edit in class BasicInstrumentor
Parameters:
cName - Name of the class to be instrumented (e.g., java.lang.Object).
Returns:
The instrumented class in Javassist's representation. It must be null if the class is not instrumented.
Throws:
javassist.NotFoundException - If Javassist fails to find the class.
javassist.CannotCompileException - If Javassist fails to correctly instrument the class.

edit

public javassist.CtClass edit(javassist.CtClass clazz)
                       throws javassist.CannotCompileException
Description copied from class: BasicInstrumentor
Provides a hook to instrument a class specified in Javassist's representation. The default implementation calls the hooks to instrument all its methods, including its class initializer method (if any), all its declared constructors, and all its declared methods.

Overrides:
edit in class BasicInstrumentor
Parameters:
clazz - Javassist's representation of the class to be instrumented.
Returns:
The instrumented class in Javassist's representation. It must be null if the class is not instrumented.
Throws:
javassist.CannotCompileException - If Javassist fails to correctly instrument the class.