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 java.lang.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
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.MethodaddTransformerTheInstrumentation#addTransformermethod.private java.lang.reflect.MethodisModifiableClassTheInstrumentation#isModifiableClassmethod.private java.lang.reflect.MethodisRetransformClassesSupportedTheInstrumentation#isRetransformClassesSupportedmethod.private java.lang.reflect.MethodretransformClassesTheInstrumentation#retransformClassesmethod.
-
Constructor Summary
Constructors Modifier Constructor Description protectedForJava6CapableVm(java.lang.reflect.Method isModifiableClass, java.lang.reflect.Method isRetransformClassesSupported, java.lang.reflect.Method addTransformer, java.lang.reflect.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(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.
-
-
-
Field Detail
-
isModifiableClass
private final java.lang.reflect.Method isModifiableClass
TheInstrumentation#isModifiableClassmethod.
-
isRetransformClassesSupported
private final java.lang.reflect.Method isRetransformClassesSupported
TheInstrumentation#isRetransformClassesSupportedmethod.
-
addTransformer
private final java.lang.reflect.Method addTransformer
TheInstrumentation#addTransformermethod.
-
retransformClasses
private final java.lang.reflect.Method retransformClasses
TheInstrumentation#retransformClassesmethod.
-
-
Constructor Detail
-
ForJava6CapableVm
protected ForJava6CapableVm(java.lang.reflect.Method isModifiableClass, java.lang.reflect.Method isRetransformClassesSupported, java.lang.reflect.Method addTransformer, java.lang.reflect.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(java.lang.instrument.Instrumentation instrumentation, java.lang.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(java.lang.instrument.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(java.lang.instrument.Instrumentation instrumentation, java.lang.instrument.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(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?>[] type) throws java.lang.instrument.UnmodifiableClassExceptionRetransforms the supplied classes.- Specified by:
retransformClassesin interfaceClassReloadingStrategy.Dispatcher- 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.
-
-