Class AgentBuilder.FallbackStrategy.ByThrowableType

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Set<? extends java.lang.Class<? extends java.lang.Throwable>> types
      A set of throwable types that should trigger a fallback attempt.
    • Constructor Summary

      Constructors 
      Constructor Description
      ByThrowableType​(java.lang.Class<? extends java.lang.Throwable>... type)
      Creates a new throwable type-discriminating fallback strategy.
      ByThrowableType​(java.util.Set<? extends java.lang.Class<? extends java.lang.Throwable>> types)
      Creates a new throwable type-discriminating fallback strategy.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isFallback​(java.lang.Class<?> type, java.lang.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.
      static AgentBuilder.FallbackStrategy ofOptionalTypes()
      Creates a fallback strategy that attempts a fallback if an error indicating a type error is the reason for requesting a reattempt.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • types

        private final java.util.Set<? extends java.lang.Class<? extends java.lang.Throwable>> types
        A set of throwable types that should trigger a fallback attempt.
    • Constructor Detail

      • ByThrowableType

        public ByThrowableType​(java.lang.Class<? extends java.lang.Throwable>... type)
        Creates a new throwable type-discriminating fallback strategy.
        Parameters:
        type - The throwable types that should trigger a fallback.
      • ByThrowableType

        public ByThrowableType​(java.util.Set<? extends java.lang.Class<? extends java.lang.Throwable>> types)
        Creates a new throwable type-discriminating fallback strategy.
        Parameters:
        types - The throwable types that should trigger a fallback.
    • Method Detail

      • ofOptionalTypes

        public static AgentBuilder.FallbackStrategy ofOptionalTypes()
        Creates a fallback strategy that attempts a fallback if an error indicating a type error is the reason for requesting a reattempt.
        Returns:
        A fallback strategy that triggers a reattempt if a LinkageError or a TypeNotPresentException is raised.
      • isFallback

        public boolean isFallback​(java.lang.Class<?> type,
                                  java.lang.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.
        Specified by:
        isFallback in interface AgentBuilder.FallbackStrategy
        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