Package net.bytebuddy.agent.builder
Interface AgentBuilder.RedefinitionStrategy.Listener
-
- All Known Implementing Classes:
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
- Enclosing class:
- AgentBuilder.RedefinitionStrategy
public static interface AgentBuilder.RedefinitionStrategy.ListenerA listener to be applied during a redefinition.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAgentBuilder.RedefinitionStrategy.Listener.AdapterA listener adapter that offers non-operational implementations of all listener methods.static classAgentBuilder.RedefinitionStrategy.Listener.BatchReallocatorA batch reallocator allows to split up a failed retransformation into additional batches which are reenqueed to the current retransformation process.static classAgentBuilder.RedefinitionStrategy.Listener.CompoundA compound listener that delegates events to several listeners.static classAgentBuilder.RedefinitionStrategy.Listener.ErrorEscalatingA listener that halts a retransformation process upon an exception.static classAgentBuilder.RedefinitionStrategy.Listener.NoOpA non-operational listener.static classAgentBuilder.RedefinitionStrategy.Listener.PausingA listener that invokesThread.sleep(long)prior to every batch but the first batch.static classAgentBuilder.RedefinitionStrategy.Listener.StreamWritingA listener that writes events to aPrintStream.static classAgentBuilder.RedefinitionStrategy.Listener.YieldingA listener that invokesThread.yield()prior to every batch but the first batch.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonBatch(int index, java.util.List<java.lang.Class<?>> batch, java.util.List<java.lang.Class<?>> types)Invoked before applying a batch.voidonComplete(int amount, java.util.List<java.lang.Class<?>> types, java.util.Map<java.util.List<java.lang.Class<?>>,java.lang.Throwable> failures)Invoked upon completion of all batches.java.lang.Iterable<? extends java.util.List<java.lang.Class<?>>>onError(int index, java.util.List<java.lang.Class<?>> batch, java.lang.Throwable throwable, java.util.List<java.lang.Class<?>> types)Invoked upon an error during a batch.
-
-
-
Method Detail
-
onBatch
void onBatch(int index, java.util.List<java.lang.Class<?>> batch, java.util.List<java.lang.Class<?>> types)Invoked before applying a batch.- 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
java.lang.Iterable<? extends java.util.List<java.lang.Class<?>>> onError(int index, java.util.List<java.lang.Class<?>> batch, java.lang.Throwable throwable, java.util.List<java.lang.Class<?>> types)Invoked upon an error during a batch. This method is not invoked if the failure handler handled this error.- 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
batchbut not all classes.
-
onComplete
void onComplete(int amount, java.util.List<java.lang.Class<?>> types, java.util.Map<java.util.List<java.lang.Class<?>>,java.lang.Throwable> failures)Invoked upon completion of all batches.- 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.
-
-