Package net.bytebuddy.dynamic
Interface ClassFileLocator.ForInstrumentation.Dispatcher
- Enclosing class:
- ClassFileLocator.ForInstrumentation
@Proxied("java.lang.instrument.Instrumentation")
protected static interface ClassFileLocator.ForInstrumentation.Dispatcher
A dispatcher to interact with the
Instrumentation
API.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTransformer
(Instrumentation instrumentation, ClassFileTransformer classFileTransformer, boolean canRetransform) Registers a transformer.boolean
isRetransformClassesSupported
(Instrumentation instrumentation) Invokes theInstrumentation#isRetransformClassesSupported
method.void
retransformClasses
(Instrumentation instrumentation, Class<?>[] type) Retransforms the supplied classes.
-
Method Details
-
isRetransformClassesSupported
Invokes theInstrumentation#isRetransformClassesSupported
method.- Parameters:
instrumentation
- The instrumentation instance to invoke the method on.- Returns:
true
if the supplied instrumentation instance supports retransformation.
-
addTransformer
void addTransformer(Instrumentation instrumentation, ClassFileTransformer classFileTransformer, boolean canRetransform) Registers a transformer.- Parameters:
instrumentation
- The instrumentation instance to invoke the method on.classFileTransformer
- The class file transformer to register.canRetransform
-true
if the class file transformer should be invoked upon a retransformation.
-
retransformClasses
void retransformClasses(Instrumentation instrumentation, Class<?>[] type) throws UnmodifiableClassException Retransforms the supplied classes.- Parameters:
instrumentation
- The instrumentation instance to invoke the method on.type
- The types to retransform.- Throws:
UnmodifiableClassException
- If any of the supplied types are unmodifiable.
-