Class ModuleOpener
java.lang.Object
io.opentelemetry.javaagent.tooling.ModuleOpener
Module opener provides ability to open JPMS modules and allows instrumentation classloader to
access module contents without requiring JVM arguments modification.
Usage of this class must be guarded with an
Usage of this class must be guarded with an
net.bytebuddy.utility.JavaModule#isSupported
check as it's compiled for Java 9+, otherwise an UnsupportedClassVersionError will be
thrown for java 8.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidopen(Instrumentation instrumentation, net.bytebuddy.utility.JavaModule targetModule, ClassLoader openTo, Collection<String> packagesToOpen) Opens JPMS module to a class loader unnamed module
-
Method Details
-
open
public static void open(Instrumentation instrumentation, net.bytebuddy.utility.JavaModule targetModule, @Nullable ClassLoader openTo, Collection<String> packagesToOpen) Opens JPMS module to a class loader unnamed module- Parameters:
targetModule- target moduleopenTo- class loader to open module for, null to use the unnamed module of bootstrap classloader.packagesToOpen- packages to open
-