Class ClassInjector.UsingReflection.Dispatcher.Unavailable

java.lang.Object
net.bytebuddy.dynamic.loading.ClassInjector.UsingReflection.Dispatcher.Unavailable
All Implemented Interfaces:
ClassInjector.UsingReflection.Dispatcher
Enclosing interface:
ClassInjector.UsingReflection.Dispatcher

@Enhance public static class ClassInjector.UsingReflection.Dispatcher.Unavailable extends Object implements ClassInjector.UsingReflection.Dispatcher
Represents an unsuccessfully loaded method lookup.
  • Field Details

    • message

      private final String message
      The error message being displayed.
  • Constructor Details

    • Unavailable

      protected Unavailable(String message)
      Creates a dispatcher for a VM that does not support reflective injection.
      Parameters:
      message - The error message being displayed.
  • Method Details

    • getClassLoadingLock

      public Object getClassLoadingLock(ClassLoader classLoader, String name)
      Returns the lock for loading the specified class.
      Specified by:
      getClassLoadingLock in interface ClassInjector.UsingReflection.Dispatcher
      Parameters:
      classLoader - the class loader to inject the class into.
      name - The name of the class.
      Returns:
      The lock for loading this class.
    • findClass

      public Class<?> findClass(ClassLoader classLoader, String name)
      Looks up a class from the given class loader.
      Specified by:
      findClass in interface ClassInjector.UsingReflection.Dispatcher
      Parameters:
      classLoader - The class loader for which a class should be located.
      name - The binary name of the class that should be located.
      Returns:
      The class for the binary name or null if no such class is defined for the provided class loader.
    • defineClass

      public Class<?> defineClass(ClassLoader classLoader, String name, byte[] binaryRepresentation, @MaybeNull ProtectionDomain protectionDomain)
      Defines a class for the given class loader.
      Specified by:
      defineClass in interface ClassInjector.UsingReflection.Dispatcher
      Parameters:
      classLoader - The class loader for which a new class should be defined.
      name - The binary name of the class that should be defined.
      binaryRepresentation - The binary representation of the class.
      protectionDomain - The protection domain for the defined class.
      Returns:
      The defined, loaded class.
    • getDefinedPackage

      public Package getDefinedPackage(ClassLoader classLoader, String name)
      Looks up a package from a class loader. If the operation is not supported, falls back to ClassInjector.UsingReflection.Dispatcher.getPackage(ClassLoader, String)
      Specified by:
      getDefinedPackage in interface ClassInjector.UsingReflection.Dispatcher
      Parameters:
      classLoader - The class loader to query.
      name - The binary name of the package.
      Returns:
      The package for the given name as defined by the provided class loader or null if no such package exists.
    • getPackage

      public Package getPackage(ClassLoader classLoader, String name)
      Looks up a package from a class loader or its ancestor.
      Specified by:
      getPackage in interface ClassInjector.UsingReflection.Dispatcher
      Parameters:
      classLoader - The class loader to query.
      name - The binary name of the package.
      Returns:
      The package for the given name as defined by the provided class loader or its ancestor, or null if no such package exists.
    • definePackage

      public Package definePackage(ClassLoader classLoader, String name, @MaybeNull String specificationTitle, @MaybeNull String specificationVersion, @MaybeNull String specificationVendor, @MaybeNull String implementationTitle, @MaybeNull String implementationVersion, @MaybeNull String implementationVendor, @MaybeNull URL sealBase)
      Defines a package for the given class loader.
      Specified by:
      definePackage in interface ClassInjector.UsingReflection.Dispatcher
      Parameters:
      classLoader - The class loader for which a package is to be defined.
      name - The binary name of the package.
      specificationTitle - The specification title of the package or null if no specification title exists.
      specificationVersion - The specification version of the package or null if no specification version exists.
      specificationVendor - The specification vendor of the package or null if no specification vendor exists.
      implementationTitle - The implementation title of the package or null if no implementation title exists.
      implementationVersion - The implementation version of the package or null if no implementation version exists.
      implementationVendor - The implementation vendor of the package or null if no implementation vendor exists.
      sealBase - The seal base URL or null if the package should not be sealed.
      Returns:
      The defined package.