Package net.bytebuddy.agent.builder
Interface AgentBuilder.InstallationListener
-
- All Known Implementing Classes:
AgentBuilder.InstallationListener.Adapter,AgentBuilder.InstallationListener.Compound,AgentBuilder.InstallationListener.ErrorSuppressing,AgentBuilder.InstallationListener.NoOp,AgentBuilder.InstallationListener.StreamWriting,AgentBuilder.RedefinitionStrategy.ResubmissionStrategy.Enabled.ResubmissionInstallationListener
- Enclosing interface:
- AgentBuilder
public static interface AgentBuilder.InstallationListenerA listener that is notified during the installation and the resetting of a class file transformer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAgentBuilder.InstallationListener.AdapterAn adapter implementation for an installation listener that serves as a convenience.static classAgentBuilder.InstallationListener.CompoundA compound installation listener.static classAgentBuilder.InstallationListener.ErrorSuppressingA listener that suppresses any installation error.static classAgentBuilder.InstallationListener.NoOpA non-operational listener that does not do anything.static classAgentBuilder.InstallationListener.StreamWritingThis installation listener prints the status of any installation to aPrintStream.
-
Field Summary
Fields Modifier and Type Field Description static ThrowableSUPPRESS_ERRORIndicates that an exception is handled.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonBeforeInstall(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer)Invoked prior to the installation of a class file transformer.ThrowableonError(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.
-
-
-
Field Detail
-
SUPPRESS_ERROR
static final Throwable SUPPRESS_ERROR
Indicates that an exception is handled.
-
-
Method Detail
-
onBeforeInstall
void onBeforeInstall(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer)
Invoked prior to the installation of a class file transformer.- Parameters:
instrumentation- The instrumentation on which the class file transformer is installed.classFileTransformer- The class file transformer that is being installed.
-
onInstall
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 byonError(Instrumentation, ResettableClassFileTransformer, Throwable).- Parameters:
instrumentation- The instrumentation on which the class file transformer is installed.classFileTransformer- The class file transformer that is being installed.
-
onError
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 toonInstall(Instrumentation, ResettableClassFileTransformer).- 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
void onReset(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer)
Invoked if an installation is reset.- Parameters:
instrumentation- The instrumentation on which the class file transformer is installed.classFileTransformer- The class file transformer that is being installed.
-
-