Package net.bytebuddy.agent.builder
Enum AgentBuilder.RedefinitionStrategy.Listener.Yielding
java.lang.Object
java.lang.Enum<AgentBuilder.RedefinitionStrategy.Listener.Yielding>
net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.Listener.Yielding
- All Implemented Interfaces:
Serializable
,Comparable<AgentBuilder.RedefinitionStrategy.Listener.Yielding>
,java.lang.constant.Constable
,AgentBuilder.RedefinitionStrategy.Listener
- Enclosing interface:
AgentBuilder.RedefinitionStrategy.Listener
public static enum AgentBuilder.RedefinitionStrategy.Listener.Yielding
extends Enum<AgentBuilder.RedefinitionStrategy.Listener.Yielding>
implements AgentBuilder.RedefinitionStrategy.Listener
A listener that invokes
Thread.yield()
prior to every batch but the first batch.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
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
-
Enum Constant Summary
Enum Constants -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked before applying a batch.void
Invoked upon completion of all batches.Invoked upon an error during a batch.Returns the enum constant of this type with the specified name.values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
The singleton instance.
-
-
Constructor Details
-
Yielding
private Yielding()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
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.
-