Package net.bytebuddy.agent.builder
Interface AgentBuilder.RedefinitionListenable
-
- All Superinterfaces:
AgentBuilder
- All Known Subinterfaces:
AgentBuilder.RedefinitionListenable.WithImplicitDiscoveryStrategy
,AgentBuilder.RedefinitionListenable.WithoutBatchStrategy
- All Known Implementing Classes:
AgentBuilder.Default.Redefining
- Enclosing interface:
- AgentBuilder
public static interface AgentBuilder.RedefinitionListenable extends AgentBuilder
An agent builder configuration that allows the registration of listeners to the redefinition process.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
AgentBuilder.RedefinitionListenable.WithImplicitDiscoveryStrategy
An agent builder configuration strategy that allows the definition of a discovery strategy.static interface
AgentBuilder.RedefinitionListenable.WithoutBatchStrategy
An agent builder configuration that allows the configuration of a batching strategy.-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder
AgentBuilder.CircularityLock, AgentBuilder.ClassFileBufferStrategy, AgentBuilder.Default, AgentBuilder.DescriptionStrategy, AgentBuilder.FallbackStrategy, AgentBuilder.Identified, AgentBuilder.Ignored, AgentBuilder.InitializationStrategy, AgentBuilder.InjectionStrategy, AgentBuilder.InstallationListener, AgentBuilder.LambdaInstrumentationStrategy, AgentBuilder.Listener, AgentBuilder.LocationStrategy, AgentBuilder.Matchable<T extends AgentBuilder.Matchable<T>>, AgentBuilder.PoolStrategy, AgentBuilder.RawMatcher, AgentBuilder.RedefinitionListenable, AgentBuilder.RedefinitionStrategy, AgentBuilder.Transformer, AgentBuilder.TransformerDecorator, AgentBuilder.TypeStrategy
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AgentBuilder.RedefinitionListenable
with(AgentBuilder.RedefinitionStrategy.Listener redefinitionListener)
A redefinition listener is invoked before each batch of type redefinitions and on every error as well as after the redefinition was completed.AgentBuilder
withResubmission(AgentBuilder.RedefinitionStrategy.ResubmissionScheduler resubmissionScheduler)
Enables resubmission of failed transformations by applying a retransformation of the loaded type.AgentBuilder
withResubmission(AgentBuilder.RedefinitionStrategy.ResubmissionScheduler resubmissionScheduler, ElementMatcher<? super java.lang.Throwable> matcher)
Enables resubmission of failed transformations by applying a retransformation of the loaded type.AgentBuilder
withResubmission(AgentBuilder.RedefinitionStrategy.ResubmissionScheduler resubmissionScheduler, ElementMatcher<? super java.lang.Throwable> matcher, ElementMatcher<? super java.lang.ClassLoader> classLoaderFilter)
Enables resubmission of failed transformations by applying a retransformation of the loaded type.-
Methods inherited from interface net.bytebuddy.agent.builder.AgentBuilder
assureReadEdgeFromAndTo, assureReadEdgeFromAndTo, assureReadEdgeFromAndTo, assureReadEdgeTo, assureReadEdgeTo, assureReadEdgeTo, disableClassFormatChanges, disableNativeMethodPrefix, enableNativeMethodPrefix, ignore, ignore, ignore, ignore, installOn, installOnByteBuddyAgent, makeRaw, patchOn, patchOnByteBuddyAgent, type, type, type, type, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with
-
-
-
-
Method Detail
-
with
AgentBuilder.RedefinitionListenable with(AgentBuilder.RedefinitionStrategy.Listener redefinitionListener)
A redefinition listener is invoked before each batch of type redefinitions and on every error as well as after the redefinition was completed. A redefinition listener can be used for debugging or logging purposes and to apply actions between each batch, e.g. to pause or wait in order to avoid rendering the current VM non-responsive if a lot of classes are redefined.
Adding several listeners does not replace previous listeners but applies them in the registration order.
- Parameters:
redefinitionListener
- The listener to register.- Returns:
- A new instance of this agent builder which notifies the specified listener upon type redefinitions.
-
withResubmission
AgentBuilder withResubmission(AgentBuilder.RedefinitionStrategy.ResubmissionScheduler resubmissionScheduler)
Enables resubmission of failed transformations by applying a retransformation of the loaded type. This can be meaningful if class files cannot be located from the class loader as a resource where the loaded type becomes available.- Parameters:
resubmissionScheduler
- A scheduler which is responsible for scheduling the resubmission job.- Returns:
- A new instance of this agent builder that applies resubmission.
-
withResubmission
AgentBuilder withResubmission(AgentBuilder.RedefinitionStrategy.ResubmissionScheduler resubmissionScheduler, ElementMatcher<? super java.lang.Throwable> matcher)
Enables resubmission of failed transformations by applying a retransformation of the loaded type. This can be meaningful if class files cannot be located from the class loader as a resource where the loaded type becomes available.- Parameters:
resubmissionScheduler
- A scheduler which is responsible for scheduling the resubmission job.matcher
- A matcher that filters throwable instances where non-matched throwables are not triggering a resubmission.- Returns:
- A new instance of this agent builder that applies resubmission.
-
withResubmission
AgentBuilder withResubmission(AgentBuilder.RedefinitionStrategy.ResubmissionScheduler resubmissionScheduler, ElementMatcher<? super java.lang.Throwable> matcher, ElementMatcher<? super java.lang.ClassLoader> classLoaderFilter)
Enables resubmission of failed transformations by applying a retransformation of the loaded type. This can be meaningful if class files cannot be located from the class loader as a resource where the loaded type becomes available.- Parameters:
resubmissionScheduler
- A scheduler which is responsible for scheduling the resubmission job.matcher
- A matcher that filters throwable instances where non-matched throwables are not triggering a resubmission.classLoaderFilter
- A filter to exclude class loader instances from resubmission before applying it.- Returns:
- A new instance of this agent builder that applies resubmission.
-
-