Package net.bytebuddy.agent.builder
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 Classes Modifier and Type Class Description protected static classAgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.Resubmitter.ConcurrentHashSet<T>A set projection for aConcurrentHashMap.-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.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.WithTransformationsOnly
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.ResubmissionEnforcer
AgentBuilder.RedefinitionStrategy.ResubmissionEnforcer.Disabled
-
-
Field Summary
Fields Modifier and Type Field Description private AgentBuilder.RedefinitionListenable.ResubmissionImmediateMatcherresubmissionImmediateMatcherA matcher to determine resubmissions without errors.private AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcherresubmissionOnErrorMatcherA matcher to determine resubmissions on errors.private java.util.concurrent.ConcurrentMap<AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.StorageKey,java.util.Set<java.lang.String>>typesA map of class loaders to their types to resubmit.-
Fields inherited from interface net.bytebuddy.agent.builder.AgentBuilder.Listener
LOADED
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedResubmitter(AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher resubmissionOnErrorMatcher, AgentBuilder.RedefinitionListenable.ResubmissionImmediateMatcher resubmissionImmediateMatcher, java.util.concurrent.ConcurrentMap<AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.StorageKey,java.util.Set<java.lang.String>> types)Creates a new resubmitter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisEnforced(java.lang.String typeName, java.lang.ClassLoader classLoader, JavaModule module, java.lang.Class<?> classBeingRedefined)Returnstrueif a class should be scheduled for resubmission.voidonError(java.lang.String typeName, java.lang.ClassLoader classLoader, JavaModule module, boolean loaded, java.lang.Throwable throwable)Invoked when an error has occurred during transformation.-
Methods inherited from class net.bytebuddy.agent.builder.AgentBuilder.Listener.Adapter
onComplete, onDiscovery, onIgnored, onTransformation
-
-
-
-
Field Detail
-
resubmissionOnErrorMatcher
private final AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher resubmissionOnErrorMatcher
A matcher to determine resubmissions on errors.
-
resubmissionImmediateMatcher
private final AgentBuilder.RedefinitionListenable.ResubmissionImmediateMatcher resubmissionImmediateMatcher
A matcher to determine resubmissions without errors.
-
types
private final java.util.concurrent.ConcurrentMap<AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.StorageKey,java.util.Set<java.lang.String>> types
A map of class loaders to their types to resubmit.
-
-
Constructor Detail
-
Resubmitter
protected Resubmitter(AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher resubmissionOnErrorMatcher, AgentBuilder.RedefinitionListenable.ResubmissionImmediateMatcher resubmissionImmediateMatcher, java.util.concurrent.ConcurrentMap<AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.StorageKey,java.util.Set<java.lang.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 Detail
-
onError
public void onError(java.lang.String typeName, @MaybeNull java.lang.ClassLoader classLoader, @MaybeNull JavaModule module, boolean loaded, java.lang.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(java.lang.String typeName, @MaybeNull java.lang.ClassLoader classLoader, @MaybeNull JavaModule module, @MaybeNull java.lang.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.
-
-