Package net.bytebuddy.agent.builder
Class AgentBuilder.RedefinitionStrategy.Listener.Pausing
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.Listener.Adapter
-
- net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.Listener.Pausing
-
- All Implemented Interfaces:
AgentBuilder.RedefinitionStrategy.Listener
- Enclosing interface:
- AgentBuilder.RedefinitionStrategy.Listener
@Enhance public static class AgentBuilder.RedefinitionStrategy.Listener.Pausing extends AgentBuilder.RedefinitionStrategy.Listener.Adapter
A listener that invokesThread.sleep(long)
prior to every batch but the first batch.
-
-
Nested Class Summary
-
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
Fields Modifier and Type Field Description private long
value
The time to sleep in milliseconds between every two batches.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Pausing(long value)
Creates a new pausing listener.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AgentBuilder.RedefinitionStrategy.Listener
of(long value, java.util.concurrent.TimeUnit timeUnit)
Creates a listener that pauses for the specified amount of time.void
onBatch(int index, java.util.List<java.lang.Class<?>> batch, java.util.List<java.lang.Class<?>> types)
Invoked before applying a batch.-
Methods inherited from class net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.Listener.Adapter
onComplete, onError
-
-
-
-
Method Detail
-
of
public static AgentBuilder.RedefinitionStrategy.Listener of(long value, java.util.concurrent.TimeUnit timeUnit)
Creates a listener that pauses for the specified amount of time. If the specified value is0
, a non-operational listener is returned.- Parameters:
value
- The amount of time to pause between redefinition batches.timeUnit
- The time unit ofvalue
.- Returns:
- An appropriate listener.
-
onBatch
public void onBatch(int index, java.util.List<java.lang.Class<?>> batch, java.util.List<java.lang.Class<?>> types)
Description copied from class:AgentBuilder.RedefinitionStrategy.Listener.Adapter
Invoked before applying a batch.- Specified by:
onBatch
in interfaceAgentBuilder.RedefinitionStrategy.Listener
- Overrides:
onBatch
in classAgentBuilder.RedefinitionStrategy.Listener.Adapter
- Parameters:
index
- A running index of the batch starting at0
.batch
- The types included in this batch.types
- All types included in the redefinition.
-
-