Package net.bytebuddy.agent.builder
Enum AgentBuilder.InstallationListener.ErrorSuppressing
java.lang.Object
java.lang.Enum<AgentBuilder.InstallationListener.ErrorSuppressing>
net.bytebuddy.agent.builder.AgentBuilder.InstallationListener.ErrorSuppressing
- All Implemented Interfaces:
Serializable
,Comparable<AgentBuilder.InstallationListener.ErrorSuppressing>
,java.lang.constant.Constable
,AgentBuilder.InstallationListener
- Enclosing interface:
AgentBuilder.InstallationListener
public static enum AgentBuilder.InstallationListener.ErrorSuppressing
extends Enum<AgentBuilder.InstallationListener.ErrorSuppressing>
implements AgentBuilder.InstallationListener
A listener that suppresses any installation error.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
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
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields inherited from interface net.bytebuddy.agent.builder.AgentBuilder.InstallationListener
SUPPRESS_ERROR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
onAfterWarmUp
(Map<Class<?>, byte[]> types, ResettableClassFileTransformer classFileTransformer, boolean transformed) Invoked after a warump is executed.void
onBeforeInstall
(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer) Invoked prior to the installation of a class file transformer.void
onBeforeWarmUp
(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.void
onInstall
(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer) Invoked upon the successful installation of a class file transformer.void
onReset
(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer) Invoked if an installation is reset.void
onWarmUpError
(Class<?> type, ResettableClassFileTransformer classFileTransformer, Throwable throwable) Invoked when a class yields an unexpected error that is not catched by the listener.Returns the enum constant of this type with the specified name.values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
The singleton instance.
-
-
Constructor Details
-
ErrorSuppressing
private ErrorSuppressing()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
onBeforeInstall
public void onBeforeInstall(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(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
@MaybeNull 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:
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(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.
-
onBeforeWarmUp
public void onBeforeWarmUp(Set<Class<?>> types, ResettableClassFileTransformer classFileTransformer) Invoked before a warump is executed.- Specified by:
onBeforeWarmUp
in 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:
onWarmUpError
in 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:
onAfterWarmUp
in interfaceAgentBuilder.InstallationListener
- Parameters:
types
- The types that are used for the warmup mapped to their transformed byte code ornull
if the type was not transformed or failed to transform.classFileTransformer
- The class file transformer that is warmed up.transformed
-true
if at least one class caused an actual transformation.
-