Package net.bytebuddy.agent.builder
Class AgentBuilder.RedefinitionStrategy.Listener.Compound
java.lang.Object
net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.Listener.Compound
- All Implemented Interfaces:
AgentBuilder.RedefinitionStrategy.Listener
- Enclosing interface:
- AgentBuilder.RedefinitionStrategy.Listener
@Enhance
public static class AgentBuilder.RedefinitionStrategy.Listener.Compound
extends Object
implements AgentBuilder.RedefinitionStrategy.Listener
A compound listener that delegates events to several listeners.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A compound iterable.Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.Listener
AgentBuilder.RedefinitionStrategy.Listener.Adapter, AgentBuilder.RedefinitionStrategy.Listener.BatchReallocator, AgentBuilder.RedefinitionStrategy.Listener.Compound, AgentBuilder.RedefinitionStrategy.Listener.ErrorEscalating, AgentBuilder.RedefinitionStrategy.Listener.NoOp, AgentBuilder.RedefinitionStrategy.Listener.Pausing, AgentBuilder.RedefinitionStrategy.Listener.StreamWriting, AgentBuilder.RedefinitionStrategy.Listener.Yielding
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<AgentBuilder.RedefinitionStrategy.Listener>
The listeners to invoke. -
Constructor Summary
ConstructorsConstructorDescriptionCompound
(List<? extends AgentBuilder.RedefinitionStrategy.Listener> listeners) Creates a new compound listener.Compound
(AgentBuilder.RedefinitionStrategy.Listener... listener) Creates a new compound listener. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked before applying a batch.void
Invoked upon completion of all batches.Invoked upon an error during a batch.
-
Field Details
-
listeners
The listeners to invoke.
-
-
Constructor Details
-
Compound
Creates a new compound listener.- Parameters:
listener
- The listeners to invoke.
-
Compound
Creates a new compound listener.- Parameters:
listeners
- The listeners to invoke.
-
-
Method Details
-
onBatch
Invoked before applying a batch.- Specified by:
onBatch
in interfaceAgentBuilder.RedefinitionStrategy.Listener
- Parameters:
index
- A running index of the batch starting at0
.batch
- The types included in this batch.types
- All types included in the redefinition.
-
onError
public Iterable<? extends List<Class<?>>> onError(int index, List<Class<?>> batch, Throwable throwable, List<Class<?>> types) Invoked upon an error during a batch. This method is not invoked if the failure handler handled this error.- Specified by:
onError
in interfaceAgentBuilder.RedefinitionStrategy.Listener
- Parameters:
index
- A running index of the batch starting at0
.batch
- The types included in this batch.throwable
- The throwable that caused this invocation.types
- All types included in the redefinition.- Returns:
- A set of classes which should be attempted to be redefined. Typically, this should be a subset of the classes
contained in
batch
but not all classes.
-
onComplete
Invoked upon completion of all batches.- Specified by:
onComplete
in interfaceAgentBuilder.RedefinitionStrategy.Listener
- Parameters:
amount
- The total amount of batches that were executed.types
- All types included in the redefinition.failures
- A mapping of batch types to their unhandled failures.
-