Class AccessControllerPlugin.Initializer

java.lang.Object
net.bytebuddy.build.AccessControllerPlugin.Initializer
All Implemented Interfaces:
ByteCodeAppender
Direct Known Subclasses:
AccessControllerPlugin.Initializer.WithoutProperty, AccessControllerPlugin.Initializer.WithProperty
Enclosing class:
AccessControllerPlugin

@Enhance protected abstract static class AccessControllerPlugin.Initializer extends Object implements ByteCodeAppender
A byte code appender to create an initializer segment that determines if the java.security.AccessController is available.
  • Field Details

    • instrumentedType

      private final TypeDescription instrumentedType
      The instrumented type.
    • name

      private final String name
      The name of the field to determine the use of access controller dispatch.
  • Constructor Details

    • Initializer

      protected Initializer(TypeDescription instrumentedType, String name)
      Creates a new initializer.
      Parameters:
      instrumentedType - The instrumented type.
      name - The name of the field to determine the use of access controller dispatch.
  • Method Details

    • apply

      public ByteCodeAppender.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod)
      Applies this byte code appender to a type creation process.
      Specified by:
      apply in interface ByteCodeAppender
      Parameters:
      methodVisitor - The method visitor to which the byte code appender writes its code to.
      implementationContext - The implementation context of the current type creation process.
      instrumentedMethod - The method that is the target of the instrumentation.
      Returns:
      The required size for the applied byte code to run.
    • onAccessController

      protected abstract int onAccessController(org.objectweb.asm.MethodVisitor methodVisitor)
      Invoked to determine if the access controller should be used after the class was found.
      Parameters:
      methodVisitor - The method visitor to dispatch to.
      Returns:
      The size of the stack required to implement the implemented dispatch.