Class AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.Resubmitter
java.lang.Object
net.bytebuddy.agent.builder.AgentBuilder.Listener.Adapter
net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.Resubmitter
- All Implemented Interfaces:
AgentBuilder.Listener, AgentBuilder.RedefinitionStrategy.ResubmissionEnforcer
- Enclosing class:
AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled
protected static class AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.Resubmitter
extends AgentBuilder.Listener.Adapter
implements AgentBuilder.RedefinitionStrategy.ResubmissionEnforcer
A handler for resubmissions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA set projection for aConcurrentHashMap.Nested classes/interfaces inherited from interface AgentBuilder.Listener
AgentBuilder.Listener.Adapter, AgentBuilder.Listener.Compound, AgentBuilder.Listener.Filtering, AgentBuilder.Listener.ModuleReadEdgeCompleting, AgentBuilder.Listener.NoOp, AgentBuilder.Listener.StreamWriting, AgentBuilder.Listener.WithErrorsOnly, AgentBuilder.Listener.WithTransformationsOnlyNested classes/interfaces inherited from interface AgentBuilder.RedefinitionStrategy.ResubmissionEnforcer
AgentBuilder.RedefinitionStrategy.ResubmissionEnforcer.Disabled -
Field Summary
FieldsModifier and TypeFieldDescriptionA matcher to determine resubmissions without errors.A matcher to determine resubmissions on errors.private final ConcurrentMap<AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.StorageKey, Set<String>> A map of class loaders to their types to resubmit.Fields inherited from interface AgentBuilder.Listener
LOADED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedResubmitter(AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher resubmissionOnErrorMatcher, AgentBuilder.RedefinitionListenable.ResubmissionImmediateMatcher resubmissionImmediateMatcher, ConcurrentMap<AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.StorageKey, Set<String>> types) Creates a new resubmitter. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEnforced(String typeName, ClassLoader classLoader, JavaModule module, Class<?> classBeingRedefined) Returnstrueif a class should be scheduled for resubmission.voidonError(String typeName, ClassLoader classLoader, JavaModule module, boolean loaded, Throwable throwable) Invoked when an error has occurred during transformation.Methods inherited from class AgentBuilder.Listener.Adapter
onComplete, onDiscovery, onIgnored, onTransformation
-
Field Details
-
resubmissionOnErrorMatcher
private final AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher resubmissionOnErrorMatcherA matcher to determine resubmissions on errors. -
resubmissionImmediateMatcher
private final AgentBuilder.RedefinitionListenable.ResubmissionImmediateMatcher resubmissionImmediateMatcherA matcher to determine resubmissions without errors. -
types
private final ConcurrentMap<AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.StorageKey, Set<String>> typesA map of class loaders to their types to resubmit.
-
-
Constructor Details
-
Resubmitter
protected Resubmitter(AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher resubmissionOnErrorMatcher, AgentBuilder.RedefinitionListenable.ResubmissionImmediateMatcher resubmissionImmediateMatcher, ConcurrentMap<AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.StorageKey, Set<String>> types) Creates a new resubmitter.- Parameters:
resubmissionOnErrorMatcher- A matcher to determine resubmissions on errors.resubmissionImmediateMatcher- A matcher to determine resubmissions without errors.types- A map of class loaders to their types to resubmit.
-
-
Method Details
-
onError
public void onError(String typeName, @MaybeNull ClassLoader classLoader, @MaybeNull JavaModule module, boolean loaded, Throwable throwable) Invoked when an error has occurred during transformation.- Specified by:
onErrorin interfaceAgentBuilder.Listener- Overrides:
onErrorin classAgentBuilder.Listener.Adapter- Parameters:
typeName- The binary name of the instrumented type.classLoader- The class loader which is loading this type ornullif loaded by the boots loader.module- The instrumented type's module ornullif the current VM does not support modules.loaded-trueif the type is already loaded.throwable- The occurred error.
-
isEnforced
public boolean isEnforced(String typeName, @MaybeNull ClassLoader classLoader, @MaybeNull JavaModule module, @MaybeNull Class<?> classBeingRedefined) Returnstrueif a class should be scheduled for resubmission.- Specified by:
isEnforcedin interfaceAgentBuilder.RedefinitionStrategy.ResubmissionEnforcer- Parameters:
typeName- The name of the instrumented class.classLoader- The class loader of the instrumented class ornullif the boot loader.module- The module of the instrumented class ornullif the module system is not supported.classBeingRedefined- The class to be redefined ornullif the current type is loaded for the first time.- Returns:
trueif the class should be scheduled for resubmission.
-