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 java.lang.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
Fields Modifier and Type Field Description private ElementMatcher<? super java.lang.ClassLoader>
classLoaderMatcher
The matcher to use for the instrumented type's class loader.private ElementMatcher<? super java.lang.Throwable>
exceptionMatcher
The matcher to use for the exception that was caused.private ElementMatcher<? super JavaModule>
moduleMatcher
The matcher to use for the instrumented type's module.private ElementMatcher<java.lang.String>
typeNameMatcher
The matcher to use for the instrumented type's name.
-
Constructor Summary
Constructors Constructor Description ForElementMatchers(ElementMatcher<? super java.lang.Throwable> exceptionMatcher, ElementMatcher<java.lang.String> typeNameMatcher, ElementMatcher<? super java.lang.ClassLoader> classLoaderMatcher, ElementMatcher<? super JavaModule> moduleMatcher)
Creates a new matcher for resubmission upon an exception that is using element matchers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(java.lang.Throwable throwable, java.lang.String typeName, java.lang.ClassLoader classLoader, JavaModule module)
Returnstrue
if a type should be resubmitted if it is not yet loaded and an exception occurs during instrumentation.
-
-
-
Field Detail
-
exceptionMatcher
private final ElementMatcher<? super java.lang.Throwable> exceptionMatcher
The matcher to use for the exception that was caused.
-
typeNameMatcher
private final ElementMatcher<java.lang.String> typeNameMatcher
The matcher to use for the instrumented type's name.
-
classLoaderMatcher
private final ElementMatcher<? super java.lang.ClassLoader> classLoaderMatcher
The matcher to use for the instrumented type's class loader.
-
moduleMatcher
private final ElementMatcher<? super JavaModule> moduleMatcher
The matcher to use for the instrumented type's module.
-
-
Constructor Detail
-
ForElementMatchers
public ForElementMatchers(ElementMatcher<? super java.lang.Throwable> exceptionMatcher, ElementMatcher<java.lang.String> typeNameMatcher, ElementMatcher<? super java.lang.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 Detail
-
matches
public boolean matches(java.lang.Throwable throwable, java.lang.String typeName, java.lang.ClassLoader classLoader, JavaModule module)
Returnstrue
if a type should be resubmitted if it is not yet loaded and an exception occurs during instrumentation.- Specified by:
matches
in interfaceAgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher
- Parameters:
throwable
- The exception being raised.typeName
- The name of the instrumented type.classLoader
- The class loader of the instrumented type ornull
if the type is loaded by the bootstrap class loader.module
- The module of the instrumented type ornull
if the current VM does not support modules.- Returns:
true
if the type should be resubmitted.
-
-