Package net.bytebuddy.agent.builder
Class AgentBuilder.RedefinitionStrategy.Dispatcher.ForJava6CapableVm
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.Dispatcher.ForJava6CapableVm
-
- All Implemented Interfaces:
AgentBuilder.RedefinitionStrategy.Dispatcher
- Enclosing interface:
- AgentBuilder.RedefinitionStrategy.Dispatcher
@Enhance public static class AgentBuilder.RedefinitionStrategy.Dispatcher.ForJava6CapableVm extends java.lang.Object implements AgentBuilder.RedefinitionStrategy.Dispatcher
A dispatcher for a Java 6 capable VM.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.Dispatcher
AgentBuilder.RedefinitionStrategy.Dispatcher.CreationAction, AgentBuilder.RedefinitionStrategy.Dispatcher.ForJava6CapableVm, AgentBuilder.RedefinitionStrategy.Dispatcher.ForLegacyVm
-
-
Field Summary
Fields Modifier and Type Field Description 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 retransformClasses)Creates a new Java 6 capable dispatcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisModifiableClass(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?> type)Checks if the supplied type is modifiable.booleanisRetransformClassesSupported(java.lang.instrument.Instrumentation instrumentation)Checks if retransformation is supported for the supplied instrumentation instance.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.
-
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 retransformClasses)Creates a new Java 6 capable dispatcher.- Parameters:
isModifiableClass- TheInstrumentation#isModifiableClassmethod.isRetransformClassesSupported- TheInstrumentation#isRetransformClassesSupportedmethod.retransformClasses- TheInstrumentation#retransformClassesmethod.
-
-
Method Detail
-
isModifiableClass
public boolean isModifiableClass(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?> type)Checks if the supplied type is modifiable.- Specified by:
isModifiableClassin interfaceAgentBuilder.RedefinitionStrategy.Dispatcher- Parameters:
instrumentation- The instrumentation instance available.type- The type to check for modifiability.- Returns:
trueif the supplied type is modifiable.
-
isRetransformClassesSupported
public boolean isRetransformClassesSupported(java.lang.instrument.Instrumentation instrumentation)
Checks if retransformation is supported for the supplied instrumentation instance.- Specified by:
isRetransformClassesSupportedin interfaceAgentBuilder.RedefinitionStrategy.Dispatcher- Parameters:
instrumentation- The instrumentation instance available.- Returns:
trueif the supplied instance supports 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 interfaceAgentBuilder.RedefinitionStrategy.Dispatcher- Parameters:
instrumentation- The instrumentation instance to use for retransformation.type- The types to retransform.- Throws:
java.lang.instrument.UnmodifiableClassException- If the supplied classes cannot be retransformed.
-
-