|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.monitoring.runtime.instrumentation.ConstructorInstrumenter
public class ConstructorInstrumenter
Instruments bytecode by inserting a specified call in the constructor of a
given class. This class is intended to be loaded by a javaagent; end-users
will want to add ConstructorCallbacks by invoking
instrumentClass(Class, ConstructorCallback).
| Method Summary | |
|---|---|
static byte[] |
instrument(byte[] originalBytes,
Class<?> classBeingRedefined)
Given the bytes representing a class, add invocations of the ConstructorCallback method to the constructor. |
static void |
instrumentClass(Class<?> c,
ConstructorCallback<?> sampler)
Ensures that the given sampler will be invoked every time a constructor for class c is invoked. |
static void |
invokeSamplers(Object o)
Bytecode is rewritten to invoke this method; it calls the sampler for the given class. |
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 |
| Method Detail |
|---|
public static void instrumentClass(Class<?> c,
ConstructorCallback<?> sampler)
throws UnmodifiableClassException
c - The class to be trackedsampler - the code to be invoked when an instance of c is constructed
UnmodifiableClassException
public byte[] transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer)
transform in interface ClassFileTransformer
public static byte[] instrument(byte[] originalBytes,
Class<?> classBeingRedefined)
originalBytes - the original byte[] code.
byte[] code.public static void invokeSamplers(Object o)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||