Package net.bytebuddy.dynamic.loading
Interface ClassInjector.UsingInstrumentation.Dispatcher
- Enclosing class:
- ClassInjector.UsingInstrumentation
@Proxied("java.lang.instrument.Instrumentation")
protected static interface ClassInjector.UsingInstrumentation.Dispatcher
A dispatcher to interact with the instrumentation API.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendToBootstrapClassLoaderSearch
(Instrumentation instrumentation, JarFile jarFile) Appends a jar file to the bootstrap class loader.void
appendToSystemClassLoaderSearch
(Instrumentation instrumentation, JarFile jarFile) Appends a jar file to the system class loader.boolean
isModifiableModule
(Instrumentation instrumentation, Object module) Checks if a module is modifiable.void
redefineModule
(Instrumentation instrumentation, Object module, Set<?> reads, Map<String, Set<?>> exports, Map<String, Set<?>> opens, Set<Class<?>> uses, Map<Class<?>, List<Class<?>>> provides) Redefines an existing module.
-
Method Details
-
appendToBootstrapClassLoaderSearch
Appends a jar file to the bootstrap class loader.- Parameters:
instrumentation
- The instrumentation instance to interact with.jarFile
- The jar file to append.
-
appendToSystemClassLoaderSearch
Appends a jar file to the system class loader.- Parameters:
instrumentation
- The instrumentation instance to interact with.jarFile
- The jar file to append.
-
isModifiableModule
boolean isModifiableModule(Instrumentation instrumentation, @Proxied("java.lang.Module") Object module) Checks if a module is modifiable.- Parameters:
instrumentation
- The instrumentation instance to use for checking for modifiability.module
- Thejava.lang.Module
to examine.- Returns:
true
if the supplied module is modifiable.
-
redefineModule
void redefineModule(Instrumentation instrumentation, @Proxied("java.lang.Module") Object module, Set<?> reads, Map<String, Set<?>> exports, Map<String, Set<?>> opens, Set<Class<?>> uses, Map<Class<?>, List<Class<?>>> provides) Redefines an existing module.- Parameters:
instrumentation
- The instrumentation instance to redefine.module
- Thejava.lang.Module
to redefine.reads
- A set ofjava.lang.Module
s that are to be read additionally.exports
- A map of packages to a set ofjava.lang.Module
s to read additionally.opens
- A map of packages to a set ofjava.lang.Module
s to open to additionally.uses
- A list of types to use additionally.provides
- A list of types to their implementations to offer additionally.
-