Package net.bytebuddy.dynamic
Interface ClassFileLocator.AgentBased.Dispatcher
-
- All Known Implementing Classes:
ClassFileLocator.AgentBased.Dispatcher.ForJava6CapableVm,ClassFileLocator.AgentBased.Dispatcher.ForLegacyVm
- Enclosing class:
- ClassFileLocator.AgentBased
protected static interface ClassFileLocator.AgentBased.DispatcherA dispatcher to interact with theInstrumentationAPI.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classClassFileLocator.AgentBased.Dispatcher.CreationActionAn action to create aClassFileLocator.AgentBased.Dispatcher.static classClassFileLocator.AgentBased.Dispatcher.ForJava6CapableVmA dispatcher for a Java 6 capable VM.static classClassFileLocator.AgentBased.Dispatcher.ForLegacyVmA dispatcher for a VM that does not support retransformation.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddTransformer(Instrumentation instrumentation, ClassFileTransformer classFileTransformer, boolean canRetransform)Registers a transformer.booleanisRetransformClassesSupported(Instrumentation instrumentation)Invokes theInstrumentation#isRetransformClassesSupportedmethod.voidretransformClasses(Instrumentation instrumentation, Class<?>[] type)Retransforms the supplied classes.
-
-
-
Method Detail
-
isRetransformClassesSupported
boolean isRetransformClassesSupported(Instrumentation instrumentation)
Invokes theInstrumentation#isRetransformClassesSupportedmethod.- Parameters:
instrumentation- The instrumentation instance to invoke the method on.- Returns:
trueif 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-trueif 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.
-
-