Interface AgentBuilder.FallbackStrategy

  • All Known Implementing Classes:
    AgentBuilder.FallbackStrategy.ByThrowableType, AgentBuilder.FallbackStrategy.Simple
    Enclosing interface:
    AgentBuilder

    public static interface AgentBuilder.FallbackStrategy
    A fallback strategy allows to reattempt a transformation or a consideration for redefinition/retransformation in case an exception occurs. Doing so, it is possible to use a TypePool rather than using a loaded type description backed by a Class. Loaded types can raise exceptions and errors if a ClassLoader cannot resolve all types that this class references. Using a type pool, such errors can be avoided as type descriptions can be resolved lazily, avoiding such errors.
    • Method Detail

      • isFallback

        boolean isFallback​(Class<?> type,
                           Throwable throwable)
        Returns true if the supplied type and throwable combination should result in a reattempt where the loaded type is not used for querying information.
        Parameters:
        type - The loaded type that was queried during the transformation attempt.
        throwable - The error or exception that was caused during the transformation.
        Returns:
        true if the supplied type and throwable combination should