Class AgentBuilder.LocationStrategy.Simple

java.lang.Object
net.bytebuddy.agent.builder.AgentBuilder.LocationStrategy.Simple
All Implemented Interfaces:
AgentBuilder.LocationStrategy
Enclosing interface:
AgentBuilder.LocationStrategy

@Enhance public static class AgentBuilder.LocationStrategy.Simple extends Object implements AgentBuilder.LocationStrategy
A simple location strategy that queries a given class file locator.
  • Field Details

    • classFileLocator

      private final ClassFileLocator classFileLocator
      The class file locator to query.
  • Constructor Details

    • Simple

      public Simple(ClassFileLocator classFileLocator)
      A simple location strategy that queries a given class file locator.
      Parameters:
      classFileLocator - The class file locator to query.
  • Method Details

    • classFileLocator

      public ClassFileLocator classFileLocator(@MaybeNull ClassLoader classLoader, @MaybeNull JavaModule module)
      Creates a class file locator for a given class loader and module combination.
      Specified by:
      classFileLocator in interface AgentBuilder.LocationStrategy
      Parameters:
      classLoader - The class loader that is loading an instrumented type. Might be null to represent the bootstrap class loader.
      module - The type's module or null if Java modules are not supported on the current VM.
      Returns:
      The class file locator to use.