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 class
AgentBuilder.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.ResubmissionImmediateMatcher
resubmissionImmediateMatcher
A matcher to determine resubmissions without errors.private AgentBuilder.RedefinitionListenable.ResubmissionOnErrorMatcher
resubmissionOnErrorMatcher
A matcher to determine resubmissions on errors.private 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.-
Fields inherited from interface net.bytebuddy.agent.builder.AgentBuilder.Listener
LOADED
-
-
Constructor Summary
Constructors Modifier Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isEnforced(java.lang.String typeName, java.lang.ClassLoader classLoader, JavaModule module, java.lang.Class<?> classBeingRedefined)
Returnstrue
if a class should be scheduled for resubmission.void
onError(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, java.lang.ClassLoader classLoader, JavaModule module, boolean loaded, java.lang.Throwable throwable)
Invoked when an error has occurred during transformation.- Specified by:
onError
in interfaceAgentBuilder.Listener
- Overrides:
onError
in classAgentBuilder.Listener.Adapter
- Parameters:
typeName
- The binary name of the instrumented type.classLoader
- The class loader which is loading this type.module
- The instrumented type's module ornull
if the current VM does not support modules.loaded
-true
if the type is already loaded.throwable
- The occurred error.
-
isEnforced
public boolean isEnforced(java.lang.String typeName, java.lang.ClassLoader classLoader, JavaModule module, java.lang.Class<?> classBeingRedefined)
Returnstrue
if a class should be scheduled for resubmission.- Specified by:
isEnforced
in interfaceAgentBuilder.RedefinitionStrategy.ResubmissionEnforcer
- Parameters:
typeName
- The name of the instrumented class.classLoader
- The class loader of the instrumented class.module
- The module of the instrumented class ornull
if the module system is not supported.classBeingRedefined
- The class to be redefined ornull
if the current type is loaded for the first time.- Returns:
true
if the class should be scheduled for resubmission.
-
-