Package net.bytebuddy.dynamic
Interface ClassFileLocator.AgentBased.Dispatcher
-
- All Known Implementing Classes:
ClassFileLocator.AgentBased.Dispatcher.ForJava6CapableVm
,ClassFileLocator.AgentBased.Dispatcher.ForLegacyVm
- Enclosing class:
- ClassFileLocator.AgentBased
protected static interface ClassFileLocator.AgentBased.Dispatcher
A dispatcher to interact with theInstrumentation
API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ClassFileLocator.AgentBased.Dispatcher.CreationAction
An action to create aClassFileLocator.AgentBased.Dispatcher
.static class
ClassFileLocator.AgentBased.Dispatcher.ForJava6CapableVm
A dispatcher for a Java 6 capable VM.static class
ClassFileLocator.AgentBased.Dispatcher.ForLegacyVm
A dispatcher for a VM that does not support retransformation.
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
isRetransformClassesSupported
boolean isRetransformClassesSupported(java.lang.instrument.Instrumentation instrumentation)
Invokes theInstrumentation#isRetransformClassesSupported
method.- Parameters:
instrumentation
- The instrumentation instance to invoke the method on.- Returns:
true
if the supplied instrumentation instance supports retransformation.
-
addTransformer
void addTransformer(java.lang.instrument.Instrumentation instrumentation, java.lang.instrument.ClassFileTransformer classFileTransformer, boolean canRetransform)
Registers a transformer.- 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
void retransformClasses(java.lang.instrument.Instrumentation instrumentation, java.lang.Class<?>[] type) throws java.lang.instrument.UnmodifiableClassException
Retransforms the supplied classes.- 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.
-
-