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.Method
isModifiableClass
TheInstrumentation#isModifiableClass
method.private java.lang.reflect.Method
isRetransformClassesSupported
TheInstrumentation#isRetransformClassesSupported
method.private java.lang.reflect.Method
retransformClasses
TheInstrumentation#retransformClasses
method.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForJava6CapableVm(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 boolean
isModifiableClass(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?> type)
Checks if the supplied type is modifiable.boolean
isRetransformClassesSupported(java.lang.instrument.Instrumentation instrumentation)
Checks if retransformation is supported for the supplied instrumentation instance.void
retransformClasses(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?>[] type)
Retransforms the supplied classes.
-
-
-
Field Detail
-
isModifiableClass
private final java.lang.reflect.Method isModifiableClass
TheInstrumentation#isModifiableClass
method.
-
isRetransformClassesSupported
private final java.lang.reflect.Method isRetransformClassesSupported
TheInstrumentation#isRetransformClassesSupported
method.
-
retransformClasses
private final java.lang.reflect.Method retransformClasses
TheInstrumentation#retransformClasses
method.
-
-
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#isModifiableClass
method.isRetransformClassesSupported
- TheInstrumentation#isRetransformClassesSupported
method.retransformClasses
- TheInstrumentation#retransformClasses
method.
-
-
Method Detail
-
isModifiableClass
public boolean isModifiableClass(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?> type)
Checks if the supplied type is modifiable.- Specified by:
isModifiableClass
in interfaceAgentBuilder.RedefinitionStrategy.Dispatcher
- Parameters:
instrumentation
- The instrumentation instance available.type
- The type to check for modifiability.- Returns:
true
if 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:
isRetransformClassesSupported
in interfaceAgentBuilder.RedefinitionStrategy.Dispatcher
- Parameters:
instrumentation
- The instrumentation instance available.- Returns:
true
if the supplied instance supports retransformation.
-
retransformClasses
public void retransformClasses(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?>[] type) throws java.lang.instrument.UnmodifiableClassException
Retransforms the supplied classes.- Specified by:
retransformClasses
in 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.
-
-