Class AgentBuilder.InstallationListener.Adapter
java.lang.Object
net.bytebuddy.agent.builder.AgentBuilder.InstallationListener.Adapter
- All Implemented Interfaces:
AgentBuilder.InstallationListener
- Direct Known Subclasses:
AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.ResubmissionInstallationListener
- Enclosing interface:
AgentBuilder.InstallationListener
public abstract static class AgentBuilder.InstallationListener.Adapter
extends Object
implements AgentBuilder.InstallationListener
An adapter implementation for an installation listener that serves as a convenience.
-
Nested Class Summary
Nested classes/interfaces inherited from interface AgentBuilder.InstallationListener
AgentBuilder.InstallationListener.Adapter, AgentBuilder.InstallationListener.Compound, AgentBuilder.InstallationListener.ErrorSuppressing, AgentBuilder.InstallationListener.NoOp, AgentBuilder.InstallationListener.StreamWriting -
Field Summary
Fields inherited from interface AgentBuilder.InstallationListener
SUPPRESS_ERROR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonAfterWarmUp(Map<Class<?>, byte[]> types, ResettableClassFileTransformer classFileTransformer, boolean transformed) Invoked after a warump is executed.voidonBeforeInstall(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer) Invoked prior to the installation of a class file transformer.voidonBeforeWarmUp(Set<Class<?>> types, ResettableClassFileTransformer classFileTransformer) Invoked before a warump is executed.onError(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer, Throwable throwable) Invoked if an installation causes an error.voidonInstall(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer) Invoked upon the successful installation of a class file transformer.voidonReset(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer) Invoked if an installation is reset.voidonWarmUpError(Class<?> type, ResettableClassFileTransformer classFileTransformer, Throwable throwable) Invoked when a class yields an unexpected error that is not catched by the listener.
-
Constructor Details
-
Adapter
public Adapter()
-
-
Method Details
-
onBeforeInstall
public void onBeforeInstall(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer) Invoked prior to the installation of a class file transformer.- Specified by:
onBeforeInstallin interfaceAgentBuilder.InstallationListener- Parameters:
instrumentation- The instrumentation on which the class file transformer is installed.classFileTransformer- The class file transformer that is being installed.
-
onInstall
public void onInstall(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer) Invoked upon the successful installation of a class file transformer. This method is only invoked if no error occurred during the installation or if such an error was handled byAgentBuilder.InstallationListener.onError(Instrumentation, ResettableClassFileTransformer, Throwable).- Specified by:
onInstallin interfaceAgentBuilder.InstallationListener- Parameters:
instrumentation- The instrumentation on which the class file transformer is installed.classFileTransformer- The class file transformer that is being installed.
-
onError
public Throwable onError(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer, Throwable throwable) Invoked if an installation causes an error. The listener has an opportunity to handle the error. This method is invoked prior toAgentBuilder.InstallationListener.onInstall(Instrumentation, ResettableClassFileTransformer).- Specified by:
onErrorin interfaceAgentBuilder.InstallationListener- Parameters:
instrumentation- The instrumentation on which the class file transformer is installed.classFileTransformer- The class file transformer that is being installed.throwable- The throwable that causes the error.- Returns:
- The error to propagate or
nullif the error is handled. Any subsequent listeners are not called if the exception is handled.
-
onReset
public void onReset(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer) Invoked if an installation is reset.- Specified by:
onResetin interfaceAgentBuilder.InstallationListener- Parameters:
instrumentation- The instrumentation on which the class file transformer is installed.classFileTransformer- The class file transformer that is being installed.
-
onBeforeWarmUp
public void onBeforeWarmUp(Set<Class<?>> types, ResettableClassFileTransformer classFileTransformer) Invoked before a warump is executed.- Specified by:
onBeforeWarmUpin interfaceAgentBuilder.InstallationListener- Parameters:
types- The types that are used for the warmup.classFileTransformer- The class file transformer that is warmed up.
-
onWarmUpError
public void onWarmUpError(Class<?> type, ResettableClassFileTransformer classFileTransformer, Throwable throwable) Invoked when a class yields an unexpected error that is not catched by the listener.- Specified by:
onWarmUpErrorin interfaceAgentBuilder.InstallationListener- Parameters:
type- The type that caused the error.classFileTransformer- The class file transformer that is warmed up.throwable- The throwable that represents the error.
-
onAfterWarmUp
public void onAfterWarmUp(Map<Class<?>, byte[]> types, ResettableClassFileTransformer classFileTransformer, boolean transformed) Invoked after a warump is executed.- Specified by:
onAfterWarmUpin interfaceAgentBuilder.InstallationListener- Parameters:
types- The types that are used for the warmup mapped to their transformed byte code ornullif the type was not transformed or failed to transform.classFileTransformer- The class file transformer that is warmed up.transformed-trueif at least one class caused an actual transformation.
-