Class AgentBuilder.LocationStrategy.Compound

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

@Enhance public static class AgentBuilder.LocationStrategy.Compound extends Object implements AgentBuilder.LocationStrategy
A compound location strategy that applies a list of location strategies.
  • Field Details

  • Constructor Details

    • Compound

      public Compound(AgentBuilder.LocationStrategy... locationStrategy)
      Creates a new compound location strategy.
      Parameters:
      locationStrategy - The location strategies in their application order.
    • Compound

      public Compound(List<? extends AgentBuilder.LocationStrategy> locationStrategies)
      Creates a new compound location strategy.
      Parameters:
      locationStrategies - The location strategies in their application order.
  • 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.