Enum AgentBuilder.LocationStrategy.ForClassLoader

    • Enum Constant Detail

      • WEAK

        public static final AgentBuilder.LocationStrategy.ForClassLoader 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 Detail

      • ForClassLoader

        private ForClassLoader()
    • Method Detail

      • values

        public static AgentBuilder.LocationStrategy.ForClassLoader[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (AgentBuilder.LocationStrategy.ForClassLoader c : AgentBuilder.LocationStrategy.ForClassLoader.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static AgentBuilder.LocationStrategy.ForClassLoader valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.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​(java.util.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​(java.util.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.