Enum AgentBuilder.PatchMode

java.lang.Object
java.lang.Enum<AgentBuilder.PatchMode>
net.bytebuddy.agent.builder.AgentBuilder.PatchMode
All Implemented Interfaces:
Serializable, Comparable<AgentBuilder.PatchMode>, java.lang.constant.Constable
Enclosing interface:
AgentBuilder

public static enum AgentBuilder.PatchMode extends Enum<AgentBuilder.PatchMode>
Determines how patching a ResettableClassFileTransformer resolves the transformer exchange.
  • Enum Constant Details

    • GAP

      public static final AgentBuilder.PatchMode 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

      public static final AgentBuilder.PatchMode 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

      public static final AgentBuilder.PatchMode SUBSTITUTE
      Requires a ResettableClassFileTransformer.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 adding AgentBuilder.TransformerDecorator.ForSubstitution as a last decorator prior to installation.
  • Constructor Details

    • PatchMode

      private PatchMode()
  • Method Details

    • values

      public static AgentBuilder.PatchMode[] 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

      public static AgentBuilder.PatchMode valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • of

      protected static AgentBuilder.PatchMode of(ResettableClassFileTransformer classFileTransformer)
      Resolves a default patch mode for a given ResettableClassFileTransformer.
      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.