The class reloading strategy allows to redefine loaded java.es. Note that this strategy
will always attempt to load an existing class prior to its redefinition, even if this class is not yet loaded.
Note
In order to redefine any type, neither its name or its modifiers must be changed. Furthermore, no
fields or methods must be removed or added. This makes this strategy generally incompatible to applying it to a
rebased class definition as by net. which copies the original method
implementations to additional methods. Furthermore, even the net.
adds a method if the original class contains an explicit class initializer. For these reasons, it is not
recommended to use this ClassLoadingStrategy with arbitrary classes.
| Modifier and Type | Class and Description |
|---|---|
| protected static interface | ClassReloadingStrategy.BootstrapInjection
A strategy to apply for injecting classes into the bootstrap class loader. |
| protected static interface | ClassReloadingStrategy.Dispatcher
A dispatcher to interact with the instrumentation API. |
| public static enum | ClassReloadingStrategy.Strategy
A strategy which performs the actual redefinition of a |
| Modifier and Type | Field and Description |
|---|---|
| private final ClassReloadingStrategy. | bootstrapInjection
The strategy to apply for injecting classes into the bootstrap class loader. |
| protected static final ClassReloadingStrategy. | DISPATCHER
A dispatcher to use with some methods of the |
| private final Instrumentation | instrumentation
This instance's instrumentation. |
| private final Map | preregisteredTypes
The preregistered types of this instance. |
| private final ClassReloadingStrategy. | strategy
An strategy which performs the actual redefinition of a |
| Access | Constructor and Description |
|---|---|
| public | ClassReloadingStrategy(Instrumentation
The instrumentation to be used by this reloading strategy. instrumentation, ClassReloadingStrategy.A strategy which performs the actual redefinition of a strategyjava..Creates a class reloading strategy for the given instrumentation using an explicit transformation strategy which
is represented by an |
| protected | ClassReloadingStrategy(Instrumentation
The instrumentation to be used by this reloading strategy. instrumentation, ClassReloadingStrategy.An strategy which performs the actual redefinition of a strategy,java..The bootstrap class loader injection strategy to use. bootstrapInjection,The preregistered types of this instance. preregisteredTypes)Creates a new class reloading strategy. |
| Modifier and Type | Method and Description |
|---|---|
| private static < The type of the action's resolved value. T> T | Returns: The action's resolved value.The action to execute from a privileged context. action)A proxy for |
| public ClassReloadingStrategy | Returns: A class reloading strategy with bootstrap injection enabled.The folder to save jar files in that are appended to the bootstrap class path. folder)Enables bootstrap injection for this class reloading strategy. |
| public static ClassReloadingStrategy | Returns: A class reloading strategy which uses the Byte Buddy agent'sjava..
Obtains a |
| public static ClassReloadingStrategy | Returns: A class reloading strategy which uses the Byte Buddy agent'sjava..The strategy to use. strategy
Obtains a |
| public Map | load(ClassLoader
The class loader to used for loading the classes. classLoader, Map<TypeDescription, byte[]> Byte array representations of the types to be loaded mapped by their descriptions,
where an iteration order defines an order in which they are supposed to be loaded,
if relevant. types)Implements net. |
| public static ClassReloadingStrategy | Returns: A suitable class reloading strategy.The instrumentation to be used by this reloading strategy. instrumentation)Creates a class reloading strategy for the given instrumentation. |
| public ClassReloadingStrategy | Returns: This class reloading strategy with the given types being explicitly available.The loaded types that are explicitly available. type)Registers a type to be explicitly available without explicit lookup. |
| public ClassReloadingStrategy | |
| public ClassReloadingStrategy | Returns: This class reloading strategy.The class file locator to use. classFileLocator, Class<?>... The types to reset. type)Resets all classes to their original definition. |
| private static Instrumentation | Returns: The installed instrumentation instance.Resolves the instrumentation provided by |