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.Dispatcher
A dispatcher to interact with the instrumentation API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ClassReloadingStrategy.Dispatcher.CreationAction
An action to create an appropriateClassReloadingStrategy.Dispatcher
.static class
ClassReloadingStrategy.Dispatcher.ForJava6CapableVm
A dispatcher for a Java 6 capable VM that is potentially capable of retransformation.static class
ClassReloadingStrategy.Dispatcher.ForLegacyVm
A dispatcher for a legacy VM that does not support retransformation.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addTransformer(Instrumentation instrumentation, ClassFileTransformer classFileTransformer, boolean canRetransform)
Registers a transformer.boolean
isModifiableClass(Instrumentation instrumentation, Class<?> type)
Invokes theInstrumentation#isModifiableClass
method.boolean
isRetransformClassesSupported(Instrumentation instrumentation)
Invokes theInstrumentation#isRetransformClassesSupported
method.void
retransformClasses(Instrumentation instrumentation, Class<?>[] type)
Retransforms the supplied classes.
-
-
-
Method Detail
-
isModifiableClass
boolean isModifiableClass(Instrumentation instrumentation, Class<?> type)
Invokes theInstrumentation#isModifiableClass
method.- Parameters:
instrumentation
- The instrumentation instance to invoke the method on.type
- The type to consider for modifiability.- Returns:
true
if the supplied type can be modified.
-
isRetransformClassesSupported
boolean isRetransformClassesSupported(Instrumentation instrumentation)
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.
-
-