Package net.bytebuddy.agent.builder
Enum AgentBuilder.PatchMode
- All Implemented Interfaces:
Serializable
,Comparable<AgentBuilder.PatchMode>
,java.lang.constant.Constable
- Enclosing interface:
AgentBuilder
Determines how patching a
ResettableClassFileTransformer
resolves the transformer exchange.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
A handler to allow for callbacks prior and after registering aClassFileTransformer
.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAllows for a short period where neither class file transformer is registered.Allows for a short period where both class file transformer are registered.Requires aResettableClassFileTransformer.Substitutable
class file transformer which can exchange the actual class file transformer without any overlaps or changes in order. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static AgentBuilder.PatchMode
of
(ResettableClassFileTransformer classFileTransformer) Resolves a default patch mode for a givenResettableClassFileTransformer
.protected abstract AgentBuilder.PatchMode.Handler
toHandler
(ResettableClassFileTransformer classFileTransformer) Resolves this strategy to a handler.static AgentBuilder.PatchMode
Returns the enum constant of this type with the specified name.static AgentBuilder.PatchMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
GAP
Allows for a short period where neither class file transformer is registered. This might allow for classes to execute without instrumentation if they are loaded in a short moment where neither transformer is registered. In some rare cases, this might also cause that these classes are not instrumented as a result of the patching. -
OVERLAP
Allows for a short period where both class file transformer are registered. This might allow for classes to apply both instrumentations. In some rare cases, this might also cause that both instrumentations are permanently applied. -
SUBSTITUTE
Requires aResettableClassFileTransformer.Substitutable
class file transformer which can exchange the actual class file transformer without any overlaps or changes in order. Normally, this can be achieved easily by addingAgentBuilder.TransformerDecorator.ForSubstitution
as a last decorator prior to installation.
-
-
Constructor Details
-
PatchMode
private PatchMode()
-
-
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
-
of
Resolves a default patch mode for a givenResettableClassFileTransformer
.- Parameters:
classFileTransformer
- The class file transformer to consider.- Returns:
- A meaningful default patch mode.
-
toHandler
protected abstract AgentBuilder.PatchMode.Handler toHandler(ResettableClassFileTransformer classFileTransformer) Resolves this strategy to a handler.- Parameters:
classFileTransformer
- The class file transformer to deregister.- Returns:
- The handler to apply.
-