Package net.bytebuddy.dynamic.loading
Interface ClassReloadingStrategy.Dispatcher
-
- All Known Implementing Classes:
ClassReloadingStrategy.Dispatcher.ForJava6CapableVm,ClassReloadingStrategy.Dispatcher.ForLegacyVm
- Enclosing class:
- ClassReloadingStrategy
protected static interface ClassReloadingStrategy.DispatcherA dispatcher to interact with the instrumentation API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classClassReloadingStrategy.Dispatcher.CreationActionAn action to create an appropriateClassReloadingStrategy.Dispatcher.static classClassReloadingStrategy.Dispatcher.ForJava6CapableVmA dispatcher for a Java 6 capable VM that is potentially capable of retransformation.static classClassReloadingStrategy.Dispatcher.ForLegacyVmA dispatcher for a legacy VM that does not support retransformation.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddTransformer(java.lang.instrument.Instrumentation instrumentation, java.lang.instrument.ClassFileTransformer classFileTransformer, boolean canRetransform)Registers a transformer.booleanisModifiableClass(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?> type)Invokes theInstrumentation#isModifiableClassmethod.booleanisRetransformClassesSupported(java.lang.instrument.Instrumentation instrumentation)Invokes theInstrumentation#isRetransformClassesSupportedmethod.voidretransformClasses(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?>[] type)Retransforms the supplied classes.
-
-
-
Method Detail
-
isModifiableClass
boolean isModifiableClass(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?> type)Invokes theInstrumentation#isModifiableClassmethod.- Parameters:
instrumentation- The instrumentation instance to invoke the method on.type- The type to consider for modifiability.- Returns:
trueif the supplied type can be modified.
-
isRetransformClassesSupported
boolean isRetransformClassesSupported(java.lang.instrument.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(java.lang.instrument.Instrumentation instrumentation, java.lang.instrument.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(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?>[] type) throws java.lang.instrument.UnmodifiableClassExceptionRetransforms the supplied classes.- Parameters:
instrumentation- The instrumentation instance to invoke the method on.type- The types to retransform.- Throws:
java.lang.instrument.UnmodifiableClassException- If any of the supplied types are unmodifiable.
-
-