Class ClassLoadingStrategy.Default.InjectionDispatcher

java.lang.Object
net.bytebuddy.dynamic.loading.ClassLoadingStrategy.Default.InjectionDispatcher
All Implemented Interfaces:
ClassLoadingStrategy<ClassLoader>, ClassLoadingStrategy.Configurable<ClassLoader>
Enclosing class:
ClassLoadingStrategy.Default

@Enhance protected static class ClassLoadingStrategy.Default.InjectionDispatcher extends Object implements ClassLoadingStrategy.Configurable<ClassLoader>

A class loading strategy which applies a class loader injection while applying a given ProtectionDomain on class injection.

Important: Class injection requires access to JVM internal methods that are sealed by security managers and the Java Platform module system. Since Java 11, access to these methods is no longer feasible unless those packages are explicitly opened.

  • Field Details

    • protectionDomain

      The protection domain to apply or null if no protection domain is set.
    • packageDefinitionStrategy

      private final PackageDefinitionStrategy packageDefinitionStrategy
      The package definer to be used for querying information on package information.
    • forbidExisting

      private final boolean forbidExisting
      Determines if an exception should be thrown when attempting to load a type that already exists.
  • Constructor Details

    • InjectionDispatcher

      protected InjectionDispatcher()
      Creates a new injection dispatcher.
    • InjectionDispatcher

      private InjectionDispatcher(@MaybeNull ProtectionDomain protectionDomain, PackageDefinitionStrategy packageDefinitionStrategy, boolean forbidExisting)
      Creates a new injection dispatcher.
      Parameters:
      protectionDomain - The protection domain to apply or null if no protection domain is set.
      packageDefinitionStrategy - The package definer to be used for querying information on package information.
      forbidExisting - Determines if an exception should be thrown when attempting to load a type that already exists.
  • Method Details