Package net.bytebuddy.agent.builder
Class AgentBuilder.InstallationListener.Compound
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.InstallationListener.Compound
-
- All Implemented Interfaces:
AgentBuilder.InstallationListener
- Enclosing interface:
- AgentBuilder.InstallationListener
@Enhance public static class AgentBuilder.InstallationListener.Compound extends java.lang.Object implements AgentBuilder.InstallationListener
A compound installation listener.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.InstallationListener
AgentBuilder.InstallationListener.Adapter, AgentBuilder.InstallationListener.Compound, AgentBuilder.InstallationListener.ErrorSuppressing, AgentBuilder.InstallationListener.NoOp, AgentBuilder.InstallationListener.StreamWriting
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<AgentBuilder.InstallationListener>
installationListeners
The installation listeners to notify.-
Fields inherited from interface net.bytebuddy.agent.builder.AgentBuilder.InstallationListener
SUPPRESS_ERROR
-
-
Constructor Summary
Constructors Constructor Description Compound(java.util.List<? extends AgentBuilder.InstallationListener> installationListeners)
Creates a new compound listener.Compound(AgentBuilder.InstallationListener... installationListener)
Creates a new compound listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onBeforeInstall(java.lang.instrument.Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer)
Invoked prior to the installation of a class file transformer.java.lang.Throwable
onError(java.lang.instrument.Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer, java.lang.Throwable throwable)
Invoked if an installation causes an error.void
onInstall(java.lang.instrument.Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer)
Invoked upon the successful installation of a class file transformer.void
onReset(java.lang.instrument.Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer)
Invoked if an installation is reset.
-
-
-
Field Detail
-
installationListeners
private final java.util.List<AgentBuilder.InstallationListener> installationListeners
The installation listeners to notify.
-
-
Constructor Detail
-
Compound
public Compound(AgentBuilder.InstallationListener... installationListener)
Creates a new compound listener.- Parameters:
installationListener
- The installation listeners to notify.
-
Compound
public Compound(java.util.List<? extends AgentBuilder.InstallationListener> installationListeners)
Creates a new compound listener.- Parameters:
installationListeners
- The installation listeners to notify.
-
-
Method Detail
-
onBeforeInstall
public void onBeforeInstall(java.lang.instrument.Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer)
Invoked prior to the installation of a class file transformer.- Specified by:
onBeforeInstall
in 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(java.lang.instrument.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:
onInstall
in 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 java.lang.Throwable onError(java.lang.instrument.Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer, java.lang.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:
onError
in 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
null
if the error is handled. Any subsequent listeners are not called if the exception is handled.
-
onReset
public void onReset(java.lang.instrument.Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer)
Invoked if an installation is reset.- Specified by:
onReset
in interfaceAgentBuilder.InstallationListener
- Parameters:
instrumentation
- The instrumentation on which the class file transformer is installed.classFileTransformer
- The class file transformer that is being installed.
-
-