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 TypeMethodDescriptionvoidappendToBootstrapClassLoaderSearch(Instrumentation instrumentation, JarFile jarFile) Appends a jar file to the bootstrap class loader.voidappendToSystemClassLoaderSearch(Instrumentation instrumentation, JarFile jarFile) Appends a jar file to the system class loader.booleanisModifiableModule(Instrumentation instrumentation, Object module) Checks if a module is modifiable.voidredefineModule(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.Moduleto examine.- Returns:
trueif 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.Moduleto redefine.reads- A set ofjava.lang.Modules that are to be read additionally.exports- A map of packages to a set ofjava.lang.Modules to read additionally.opens- A map of packages to a set ofjava.lang.Modules to open to additionally.uses- A list of types to use additionally.provides- A list of types to their implementations to offer additionally.
-