@HashCodeAndEqualsPlugin.Enhance public abstract static class ResettableClassFileTransformer.WithDelegation extends ResettableClassFileTransformer.AbstractBase
AgentBuilder.TransformerDecorator.| Modifier and Type | Class and Description |
|---|---|
static interface |
ResettableClassFileTransformer.WithDelegation.Callback<T>
A callback that is invoked upon class file transformation.
|
protected static class |
ResettableClassFileTransformer.WithDelegation.Substitutable
A standard implementation of a substitutable
ResettableClassFileTransformer. |
protected static class |
ResettableClassFileTransformer.WithDelegation.WithCallback<T>
A class file transformer with a callback.
|
ResettableClassFileTransformer.AbstractBase, ResettableClassFileTransformer.WithDelegation| Modifier and Type | Field and Description |
|---|---|
protected ResettableClassFileTransformer |
classFileTransformer
The class file transformer to delegate to.
|
| Modifier | Constructor and Description |
|---|---|
protected |
WithDelegation(ResettableClassFileTransformer classFileTransformer)
Creates a new delegating resettable class file transformer.
|
| Modifier and Type | Method and Description |
|---|---|
Iterator<AgentBuilder.Transformer> |
iterator(TypeDescription typeDescription,
ClassLoader classLoader,
JavaModule module,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain)
Creates an iterator over the transformers that are applied for a given type.
|
static ResettableClassFileTransformer |
of(ResettableClassFileTransformer classFileTransformer,
ResettableClassFileTransformer.WithDelegation.Callback<?> callback)
Creates a resettable class file transformer that wraps another transformer and adds a callback to the
beginning and end of each transformation.
|
boolean |
reset(Instrumentation instrumentation,
ResettableClassFileTransformer classFileTransformer,
AgentBuilder.RedefinitionStrategy redefinitionStrategy,
AgentBuilder.RedefinitionStrategy.DiscoveryStrategy redefinitionDiscoveryStrategy,
AgentBuilder.RedefinitionStrategy.BatchAllocator redefinitionBatchAllocator,
AgentBuilder.RedefinitionStrategy.Listener redefinitionListener)
Deregisters this class file transformer and redefines any transformed class to its state without this
class file transformer applied, if the supplied redefinition strategy is enabled.
|
reset, reset, reset, reset, reset, reset, resetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittransformprotected final ResettableClassFileTransformer classFileTransformer
protected WithDelegation(ResettableClassFileTransformer classFileTransformer)
classFileTransformer - The class file transformer to delegate to.public static ResettableClassFileTransformer of(ResettableClassFileTransformer classFileTransformer, ResettableClassFileTransformer.WithDelegation.Callback<?> callback)
classFileTransformer - The class file transformer to delegate to.callback - The callback to invoke.public Iterator<AgentBuilder.Transformer> iterator(TypeDescription typeDescription, @MaybeNull ClassLoader classLoader, @MaybeNull JavaModule module, @MaybeNull Class<?> classBeingRedefined, @MaybeNull ProtectionDomain protectionDomain)
typeDescription - A description of a type.classLoader - The type's class loader or null if the boot loader.module - The type's module or null if the module system is not supported by the current VM.classBeingRedefined - The class being redefined or null if the type is not yet loaded.protectionDomain - The type's protection domain or null if not available.public boolean reset(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer, AgentBuilder.RedefinitionStrategy redefinitionStrategy, AgentBuilder.RedefinitionStrategy.DiscoveryStrategy redefinitionDiscoveryStrategy, AgentBuilder.RedefinitionStrategy.BatchAllocator redefinitionBatchAllocator, AgentBuilder.RedefinitionStrategy.Listener redefinitionListener)
Deregisters this class file transformer and redefines any transformed class to its state without this
class file transformer applied, if the supplied redefinition strategy is enabled. If it is not enabled,
only the AgentBuilder.InstallationListener is informed about the
resetting without undoing any code changes.
Note: A reset class file transformer should not be reinstalled. Instead, the AgentBuilder
which built the transformer should be asked to install a new transformer.
Important: Most JVMs do not support changes of a class's structure after a class was already
loaded. Therefore, it is typically required that this class file transformer was built while enabling
AgentBuilder.disableClassFormatChanges().
instrumentation - The instrumentation instance from which to deregister the transformer.classFileTransformer - The actual class file transformer to deregister which might be this instance or any wrapper.redefinitionStrategy - The redefinition to apply.redefinitionDiscoveryStrategy - The discovery strategy for the types to reset.redefinitionBatchAllocator - The batch allocator to use.redefinitionListener - The redefinition listener to apply.true if a reset was applied and this transformer was not previously removed.Copyright © 2014–2025. All rights reserved.