Class AgentBuilder.FallbackStrategy.ByThrowableType
java.lang.Object
net.bytebuddy.agent.builder.AgentBuilder.FallbackStrategy.ByThrowableType
- All Implemented Interfaces:
AgentBuilder.FallbackStrategy
- Enclosing interface:
AgentBuilder.FallbackStrategy
@Enhance
public static class AgentBuilder.FallbackStrategy.ByThrowableType
extends Object
implements AgentBuilder.FallbackStrategy
A fallback strategy that discriminates by the type of the
Throwable that triggered a request.-
Nested Class Summary
Nested classes/interfaces inherited from interface AgentBuilder.FallbackStrategy
AgentBuilder.FallbackStrategy.ByThrowableType, AgentBuilder.FallbackStrategy.Simple -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionByThrowableType(Class<? extends Throwable>... type) Creates a new throwable type-discriminating fallback strategy.ByThrowableType(Set<? extends Class<? extends Throwable>> types) Creates a new throwable type-discriminating fallback strategy. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisFallback(Class<?> type, Throwable throwable) Returnstrueif the supplied type and throwable combination should result in a reattempt where the loaded type is not used for querying information.Creates a fallback strategy that attempts a fallback if an error indicating a type error is the reason for requesting a reattempt.
-
Field Details
-
types
-
-
Constructor Details
-
ByThrowableType
-
ByThrowableType
-
-
Method Details
-
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
LinkageErroror aTypeNotPresentExceptionis raised.
-
isFallback
Returnstrueif the supplied type and throwable combination should result in a reattempt where the loaded type is not used for querying information.- Specified by:
isFallbackin interfaceAgentBuilder.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:
trueif the supplied type and throwable combination should
-