de.twenty11.unitprofile.agent
Class ProfilingClassFileTransformer

java.lang.Object
  extended by de.twenty11.unitprofile.agent.ProfilingClassFileTransformer
All Implemented Interfaces:
ClassFileTransformer

public class ProfilingClassFileTransformer
extends Object
implements ClassFileTransformer

finds (for profiling) annotated methods and uses them as root for instrumentation.


Constructor Summary
ProfilingClassFileTransformer(Instrumentation inst)
           
 
Method Summary
 void addInstrumentation(MethodDescriptor instrumentation)
           
 Instrumentation getInstrumentation()
           
 List<MethodDescriptor> getInstrumentations()
           
 Transformation getTransformation(String classname)
           
 boolean isAlreadyInstrumented(MethodDescriptor instrumentation)
           
protected  void profile(javassist.CtMethod m, javassist.CtClass cc)
           
 byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfilingClassFileTransformer

public ProfilingClassFileTransformer(Instrumentation inst)
Method Detail

transform

public byte[] transform(ClassLoader loader,
                        String className,
                        Class<?> classBeingRedefined,
                        ProtectionDomain protectionDomain,
                        byte[] classfileBuffer)
                 throws IllegalClassFormatException
Specified by:
transform in interface ClassFileTransformer
Throws:
IllegalClassFormatException

profile

protected final void profile(javassist.CtMethod m,
                             javassist.CtClass cc)
                      throws javassist.CannotCompileException
Throws:
javassist.CannotCompileException

isAlreadyInstrumented

public boolean isAlreadyInstrumented(MethodDescriptor instrumentation)

addInstrumentation

public void addInstrumentation(MethodDescriptor instrumentation)

getInstrumentations

public List<MethodDescriptor> getInstrumentations()

getInstrumentation

public Instrumentation getInstrumentation()

getTransformation

public Transformation getTransformation(String classname)


Copyright © 2013. All rights reserved.