public class InstrumentationProxy extends InstrumentationWrapper
Instrumentation interface and adds a few extra methods. In previous agent
versions it was used to create a consistent api across Java 5/6, but now it's kind of useless. We could remove this
class and move most of the logic it contains to a static helper.delegate| Modifier | Constructor and Description |
|---|---|
protected |
InstrumentationProxy(java.lang.instrument.Instrumentation instrumentation,
boolean enableBootstrapClassInstrumentationDefault) |
| Modifier and Type | Method and Description |
|---|---|
static void |
forceRedefinition(java.lang.instrument.Instrumentation instrumentation,
java.lang.Class<?>... classes)
The
InstrumentationWrapper.retransformClasses(Class...) method is known to ignore retransform requests for bootstrap classes. |
int |
getClassReaderFlags() |
protected java.lang.instrument.Instrumentation |
getInstrumentation() |
static InstrumentationProxy |
getInstrumentationProxy(java.lang.instrument.Instrumentation inst) |
boolean |
isAppendToClassLoaderSearchSupported() |
boolean |
isBootstrapClassInstrumentationEnabled()
Returns true if instrumentation should be turned on for bootstrap classes.
|
void |
redefineClasses(java.lang.instrument.ClassDefinition... definitions) |
java.lang.Class<?>[] |
retransformUninstrumentedClasses(java.lang.String... classNames) |
retransformClassesaddTransformer, addTransformer, appendToBootstrapClassLoaderSearch, appendToSystemClassLoaderSearch, getAllLoadedClasses, getInitiatedClasses, getObjectSize, isModifiableClass, isNativeMethodPrefixSupported, isRedefineClassesSupported, isRetransformClassesSupported, removeTransformer, setNativeMethodPrefixprotected InstrumentationProxy(java.lang.instrument.Instrumentation instrumentation,
boolean enableBootstrapClassInstrumentationDefault)
public static InstrumentationProxy getInstrumentationProxy(java.lang.instrument.Instrumentation inst)
protected java.lang.instrument.Instrumentation getInstrumentation()
public void redefineClasses(java.lang.instrument.ClassDefinition... definitions)
throws java.lang.ClassNotFoundException,
java.lang.instrument.UnmodifiableClassException
redefineClasses in interface java.lang.instrument.InstrumentationredefineClasses in class InstrumentationWrapperjava.lang.ClassNotFoundExceptionjava.lang.instrument.UnmodifiableClassExceptionpublic java.lang.Class<?>[] retransformUninstrumentedClasses(java.lang.String... classNames)
throws java.lang.instrument.UnmodifiableClassException,
java.lang.ClassNotFoundException
java.lang.instrument.UnmodifiableClassExceptionjava.lang.ClassNotFoundExceptionpublic int getClassReaderFlags()
public final boolean isBootstrapClassInstrumentationEnabled()
public boolean isAppendToClassLoaderSearchSupported()
public static void forceRedefinition(java.lang.instrument.Instrumentation instrumentation,
java.lang.Class<?>... classes)
throws java.lang.ClassNotFoundException,
java.lang.instrument.UnmodifiableClassException
InstrumentationWrapper.retransformClasses(Class...) method is known to ignore retransform requests for bootstrap classes. A
call to redefineClasses(ClassDefinition...) with the original class bytes seems to trigger the
retransform, and that's what this method does.java.lang.ClassNotFoundExceptionjava.lang.instrument.UnmodifiableClassException