Package net.bytebuddy.dynamic.loading
Class ClassReloadingStrategy.Dispatcher.ForJava6CapableVm
- java.lang.Object
-
- net.bytebuddy.dynamic.loading.ClassReloadingStrategy.Dispatcher.ForJava6CapableVm
-
- All Implemented Interfaces:
ClassReloadingStrategy.Dispatcher
- Enclosing interface:
- ClassReloadingStrategy.Dispatcher
public static class ClassReloadingStrategy.Dispatcher.ForJava6CapableVm extends Object implements ClassReloadingStrategy.Dispatcher
A dispatcher for a Java 6 capable VM that is potentially capable of retransformation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.loading.ClassReloadingStrategy.Dispatcher
ClassReloadingStrategy.Dispatcher.CreationAction, ClassReloadingStrategy.Dispatcher.ForJava6CapableVm, ClassReloadingStrategy.Dispatcher.ForLegacyVm
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedForJava6CapableVm(Method isModifiableClass, Method isRetransformClassesSupported, Method addTransformer, Method retransformClasses)Creates a dispatcher for a Java 6 compatible VM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTransformer(Instrumentation instrumentation, ClassFileTransformer classFileTransformer, boolean canRetransform)Registers a transformer.booleanisModifiableClass(Instrumentation instrumentation, Class<?> type)Invokes theInstrumentation#isModifiableClassmethod.booleanisRetransformClassesSupported(Instrumentation instrumentation)Invokes theInstrumentation#isRetransformClassesSupportedmethod.voidretransformClasses(Instrumentation instrumentation, Class<?>[] type)Retransforms the supplied classes.
-
-
-
Constructor Detail
-
ForJava6CapableVm
protected ForJava6CapableVm(Method isModifiableClass, Method isRetransformClassesSupported, Method addTransformer, Method retransformClasses)
Creates a dispatcher for a Java 6 compatible VM.- Parameters:
isModifiableClass- TheInstrumentation#isModifiableClassmethod.isRetransformClassesSupported- TheInstrumentation#isRetransformClassesSupportedmethod.addTransformer- TheInstrumentation#addTransformermethod.retransformClasses- TheInstrumentation#retransformClassesmethod.
-
-
Method Detail
-
isModifiableClass
public boolean isModifiableClass(Instrumentation instrumentation, Class<?> type)
Invokes theInstrumentation#isModifiableClassmethod.- Specified by:
isModifiableClassin interfaceClassReloadingStrategy.Dispatcher- 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
public boolean isRetransformClassesSupported(Instrumentation instrumentation)
Invokes theInstrumentation#isRetransformClassesSupportedmethod.- Specified by:
isRetransformClassesSupportedin interfaceClassReloadingStrategy.Dispatcher- Parameters:
instrumentation- The instrumentation instance to invoke the method on.- Returns:
trueif the supplied instrumentation instance supports retransformation.
-
addTransformer
public void addTransformer(Instrumentation instrumentation, ClassFileTransformer classFileTransformer, boolean canRetransform)
Registers a transformer.- Specified by:
addTransformerin interfaceClassReloadingStrategy.Dispatcher- 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
public void retransformClasses(Instrumentation instrumentation, Class<?>[] type) throws UnmodifiableClassException
Retransforms the supplied classes.- Specified by:
retransformClassesin interfaceClassReloadingStrategy.Dispatcher- 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.
-
-