Package net.bytebuddy.dynamic
Class ClassFileLocator.AgentBased.Dispatcher.ForJava6CapableVm
- java.lang.Object
-
- net.bytebuddy.dynamic.ClassFileLocator.AgentBased.Dispatcher.ForJava6CapableVm
-
- All Implemented Interfaces:
ClassFileLocator.AgentBased.Dispatcher
- Enclosing interface:
- ClassFileLocator.AgentBased.Dispatcher
@Enhance public static class ClassFileLocator.AgentBased.Dispatcher.ForJava6CapableVm extends java.lang.Object implements ClassFileLocator.AgentBased.Dispatcher
A dispatcher for a Java 6 capable VM.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.ClassFileLocator.AgentBased.Dispatcher
ClassFileLocator.AgentBased.Dispatcher.CreationAction, ClassFileLocator.AgentBased.Dispatcher.ForJava6CapableVm, ClassFileLocator.AgentBased.Dispatcher.ForLegacyVm
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Method
addTransformer
TheInstrumentation#addTransformer
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 isRetransformClassesSupported, java.lang.reflect.Method addTransformer, java.lang.reflect.Method retransformClasses)
Creates a dispatcher for a Java 6 capable VM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTransformer(java.lang.instrument.Instrumentation instrumentation, java.lang.instrument.ClassFileTransformer classFileTransformer, boolean canRetransform)
Registers a transformer.boolean
isRetransformClassesSupported(java.lang.instrument.Instrumentation instrumentation)
Invokes theInstrumentation#isRetransformClassesSupported
method.void
retransformClasses(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?>[] type)
Retransforms the supplied classes.
-
-
-
Field Detail
-
isRetransformClassesSupported
private final java.lang.reflect.Method isRetransformClassesSupported
TheInstrumentation#isRetransformClassesSupported
method.
-
addTransformer
private final java.lang.reflect.Method addTransformer
TheInstrumentation#addTransformer
method.
-
retransformClasses
private final java.lang.reflect.Method retransformClasses
TheInstrumentation#retransformClasses
method.
-
-
Constructor Detail
-
ForJava6CapableVm
protected ForJava6CapableVm(java.lang.reflect.Method isRetransformClassesSupported, java.lang.reflect.Method addTransformer, java.lang.reflect.Method retransformClasses)
Creates a dispatcher for a Java 6 capable VM.- Parameters:
isRetransformClassesSupported
- TheInstrumentation#isRetransformClassesSupported
method.addTransformer
- TheInstrumentation#addTransformer
method.retransformClasses
- TheInstrumentation#retransformClasses
method.
-
-
Method Detail
-
isRetransformClassesSupported
public boolean isRetransformClassesSupported(java.lang.instrument.Instrumentation instrumentation)
Invokes theInstrumentation#isRetransformClassesSupported
method.- Specified by:
isRetransformClassesSupported
in interfaceClassFileLocator.AgentBased.Dispatcher
- Parameters:
instrumentation
- The instrumentation instance to invoke the method on.- Returns:
true
if 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:
addTransformer
in interfaceClassFileLocator.AgentBased.Dispatcher
- 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
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 interfaceClassFileLocator.AgentBased.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.
-
-