Enum Class AgentBuilder.LocationStrategy.ForClassLoader

java.lang.Object
java.lang.Enum<AgentBuilder.LocationStrategy.ForClassLoader>
net.bytebuddy.agent.builder.AgentBuilder.LocationStrategy.ForClassLoader
All Implemented Interfaces:
Serializable, Comparable<AgentBuilder.LocationStrategy.ForClassLoader>, Constable, AgentBuilder.LocationStrategy
Enclosing interface:
AgentBuilder.LocationStrategy

public static enum AgentBuilder.LocationStrategy.ForClassLoader extends Enum<AgentBuilder.LocationStrategy.ForClassLoader> implements AgentBuilder.LocationStrategy
A location strategy that locates class files by querying an instrumented type's ClassLoader.
  • Enum Constant Details

    • STRONG

      A location strategy that keeps a strong reference to the class loader the created class file locator represents.
    • WEAK

      A location strategy that keeps a weak reference to the class loader the created class file locator represents. As a consequence, any returned class file locator stops working once the represented class loader is garbage collected.
  • Constructor Details

    • ForClassLoader

      private ForClassLoader()
  • Method Details

    • values

      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • withFallbackTo

      public AgentBuilder.LocationStrategy withFallbackTo(ClassFileLocator... classFileLocator)
      Adds additional location strategies as fallbacks to this location strategy.
      Parameters:
      classFileLocator - The class file locators to query if this location strategy cannot locate a class file.
      Returns:
      A compound location strategy that first applies this location strategy and then queries the supplied class file locators.
    • withFallbackTo

      public AgentBuilder.LocationStrategy withFallbackTo(Collection<? extends ClassFileLocator> classFileLocators)
      Adds additional location strategies as fallbacks to this location strategy.
      Parameters:
      classFileLocators - The class file locators to query if this location strategy cannot locate a class file.
      Returns:
      A compound location strategy that first applies this location strategy and then queries the supplied class file locators.
    • withFallbackTo

      public AgentBuilder.LocationStrategy withFallbackTo(AgentBuilder.LocationStrategy... locationStrategy)
      Adds additional location strategies as fallbacks to this location strategy.
      Parameters:
      locationStrategy - The fallback location strategies to use.
      Returns:
      A compound location strategy that first applies this location strategy and then the supplied fallback location strategies in the supplied order.
    • withFallbackTo

      public AgentBuilder.LocationStrategy withFallbackTo(List<? extends AgentBuilder.LocationStrategy> locationStrategies)
      Adds additional location strategies as fallbacks to this location strategy.
      Parameters:
      locationStrategies - The fallback location strategies to use.
      Returns:
      A compound location strategy that first applies this location strategy and then the supplied fallback location strategies in the supplied order.