Package net.bytebuddy.agent.builder
Class AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher.ForElementMatchers
java.lang.Object
net.bytebuddy.agent.builder.AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher.ForElementMatchers
- All Implemented Interfaces:
AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher
- Enclosing interface:
AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher
@Enhance
public static class AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher.ForElementMatchers
extends Object
implements AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher
A matcher for resubmission upon error that uses element matchers for each argument to determine a resubmission.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher
AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher.Conjunction, AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher.Disjunction, AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher.ForElementMatchers, AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher.Trivial -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ElementMatcher<? super ClassLoader> The matcher to use for the instrumented type's class loader.private final ElementMatcher<? super Throwable> The matcher to use for the exception that was caused.private final ElementMatcher<? super JavaModule> The matcher to use for the instrumented type's module.private final ElementMatcher<String> The matcher to use for the instrumented type's name. -
Constructor Summary
ConstructorsConstructorDescriptionForElementMatchers(ElementMatcher<? super Throwable> exceptionMatcher, ElementMatcher<String> typeNameMatcher, ElementMatcher<? super ClassLoader> classLoaderMatcher, ElementMatcher<? super JavaModule> moduleMatcher) Creates a new matcher for resubmission upon an exception that is using element matchers. -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatches(Throwable throwable, String typeName, ClassLoader classLoader, JavaModule module) Returnstrueif a type should be resubmitted if it is not yet loaded and an exception occurs during instrumentation.
-
Field Details
-
exceptionMatcher
The matcher to use for the exception that was caused. -
typeNameMatcher
The matcher to use for the instrumented type's name. -
classLoaderMatcher
The matcher to use for the instrumented type's class loader. -
moduleMatcher
The matcher to use for the instrumented type's module.
-
-
Constructor Details
-
ForElementMatchers
public ForElementMatchers(ElementMatcher<? super Throwable> exceptionMatcher, ElementMatcher<String> typeNameMatcher, ElementMatcher<? super ClassLoader> classLoaderMatcher, ElementMatcher<? super JavaModule> moduleMatcher) Creates a new matcher for resubmission upon an exception that is using element matchers.- Parameters:
exceptionMatcher- The matcher to use for the exception that was caused.typeNameMatcher- The matcher to use for the instrumented type's name.classLoaderMatcher- The matcher to use for the instrumented type's class loader.moduleMatcher- The matcher to use for the instrumented type's module.
-
-
Method Details
-
matches
public boolean matches(Throwable throwable, String typeName, @MaybeNull ClassLoader classLoader, @MaybeNull JavaModule module) Returnstrueif a type should be resubmitted if it is not yet loaded and an exception occurs during instrumentation.- Specified by:
matchesin interfaceAgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher- Parameters:
throwable- The exception being raised.typeName- The name of the instrumented type.classLoader- The class loader of the instrumented type ornullif the type is loaded by the bootstrap class loader.module- The module of the instrumented type ornullif the current VM does not support modules.- Returns:
trueif the type should be resubmitted.
-