Interface ExperimentalInstrumentationModule
public interface ExperimentalInstrumentationModule
This class is internal and is hence not for public use. Its APIs are unstable and can change at
any time.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThis class is internal and is hence not for public use. -
Method Summary
Modifier and TypeMethodDescriptionSome instrumentations need to invoke classes which are present both in the agent classloader and the instrumented application classloader.Returns a list of instrumentation helper classes that are exposed to the application class loader.default StringBy default every InstrumentationModule is loaded by an isolated classloader, even if multiple modules instrument the same application classloader.Allows instrumentation modules to choose whether the helper classes should be injected into the same class loader as the instrumented library, or into an isolated class loader.Returns a list of helper classes that will be defined in the class loader of the instrumented library.Some instrumentation need to access JPMS modules that are not accessible by default, this method provides a way to access those classes like the "--add-opens" JVM command.
-
Method Details
-
injectedClassNames
Returns a list of helper classes that will be defined in the class loader of the instrumented library. -
getModuleGroup
By default every InstrumentationModule is loaded by an isolated classloader, even if multiple modules instrument the same application classloader.Sometimes this is not desired, e.g. when instrumenting modular libraries such as the AWS SDK. In such cases the
InstrumentationModules which want to share a classloader can return the same group name from this method. -
agentPackagesToHide
Some instrumentations need to invoke classes which are present both in the agent classloader and the instrumented application classloader. By default, the classloader of the instrumentation would link those against the class provided by the agent. This setting allows to hide packages, so that matching classes are instead used from the application classloader.- Returns:
- the list of packages (without trailing dots)
-
jpmsModulesToOpen
Some instrumentation need to access JPMS modules that are not accessible by default, this method provides a way to access those classes like the "--add-opens" JVM command.- Returns:
- map of module to open as key, list of packages as value.
-
exposedClassNames
Returns a list of instrumentation helper classes that are exposed to the application class loader.When using non-inline advice helper classes are loaded into a separate class loader. Classes from that class loader aren't visible to the instrumented application. This method can be used to expose some of the helper classes to the application class loader, so that they can be loaded through the loadClass method of the application class loader. This can for example be used to add a SPI implementation that can be loaded via the ServiceLoader.
-
helperClassStrategy
Allows instrumentation modules to choose whether the helper classes should be injected into the same class loader as the instrumented library, or into an isolated class loader.
-