Bytecode Instrumentation
| 2004 JavaOne
SM
Conference | Session 3042 Copyright Hewlett Packard Co., 2004.
51
Interface ClassFileTransformer
•
Returns null if no modifications made
• New class definition:
ClassLoader.defineClass
• Redefinition:
Instrumentation.redefineClasses
byte[] transform(
ClassLoader loader, // null if system
String className, // java/util/List
Class<?> classBeingRedefined, // null if not
ProtectionDomain protectionDomain,
byte[] classfileBuffer) // input class file
throws IllegalClassFormatException