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.
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<String>
    Some instrumentations need to invoke classes which are present both in the agent classloader and the instrumented application classloader.
    default String
    By default every InstrumentationModule is loaded by an isolated classloader, even if multiple modules instrument the same application classloader.
    default void
    Only functional for Modules where InstrumentationModule.isIndyModule() returns true.
    default List<String>
    Returns a list of helper classes that will be defined in the class loader of the instrumented library.
    default Map<net.bytebuddy.utility.JavaModule,List<String>>
    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

    • injectClasses

      default void injectClasses(ClassInjector injector)
      Only functional for Modules where InstrumentationModule.isIndyModule() returns true.

      Normally, helper and advice classes are loaded in a child classloader of the instrumented classloader. This method allows to inject classes directly into the instrumented classloader instead.

      Parameters:
      injector - the builder for injecting classes
    • injectedClassNames

      default List<String> injectedClassNames()
      Returns a list of helper classes that will be defined in the class loader of the instrumented library.
    • getModuleGroup

      default String 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

      default List<String> 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

      default Map<net.bytebuddy.utility.JavaModule,List<String>> 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.