类 ShadowingClassLoader

java.lang.Object
java.lang.ClassLoader
cn.taketoday.core.DecoratingClassLoader
cn.taketoday.instrument.ShadowingClassLoader
直接已知子类:
ResourceOverridingShadowingClassLoader

public class ShadowingClassLoader extends cn.taketoday.core.DecoratingClassLoader
ClassLoader decorator that shadows an enclosing ClassLoader, applying registered transformers to all affected classes.
从以下版本开始:
4.0
作者:
Rob Harrop, Juergen Hoeller, Costin Leau
另请参阅:
  • 字段详细资料

    • DEFAULT_EXCLUDED_PACKAGES

      public static final String[] DEFAULT_EXCLUDED_PACKAGES
      Packages that are excluded by default.
  • 构造器详细资料

    • ShadowingClassLoader

      public ShadowingClassLoader(ClassLoader enclosingClassLoader)
      Create a new ShadowingClassLoader, decorating the given ClassLoader, applying DEFAULT_EXCLUDED_PACKAGES.
      参数:
      enclosingClassLoader - the ClassLoader to decorate
      另请参阅:
    • ShadowingClassLoader

      public ShadowingClassLoader(ClassLoader enclosingClassLoader, boolean defaultExcludes)
      Create a new ShadowingClassLoader, decorating the given ClassLoader.
      参数:
      enclosingClassLoader - the ClassLoader to decorate
      defaultExcludes - whether to apply DEFAULT_EXCLUDED_PACKAGES
  • 方法详细资料

    • addTransformer

      public void addTransformer(ClassFileTransformer transformer)
      Add the given ClassFileTransformer to the list of transformers that this ClassLoader will apply.
      参数:
      transformer - the ClassFileTransformer
    • copyTransformers

      public void copyTransformers(ShadowingClassLoader other)
      Copy all ClassFileTransformers from the given ClassLoader to the list of transformers that this ClassLoader will apply.
      参数:
      other - the ClassLoader to copy from
    • loadClass

      public Class<?> loadClass(String name) throws ClassNotFoundException
      覆盖:
      loadClass 在类中 ClassLoader
      抛出:
      ClassNotFoundException
    • isEligibleForShadowing

      protected boolean isEligibleForShadowing(String className)
      Determine whether the specified class is eligible for shadowing by this class loader.
      参数:
      className - the class name to check
      返回:
      whether the specified class is eligible
      另请参阅:
      • DecoratingClassLoader.isExcluded(java.lang.String)
    • getResource

      public URL getResource(String name)
      覆盖:
      getResource 在类中 ClassLoader
    • getResourceAsStream

      @Nullable public InputStream getResourceAsStream(String name)
      覆盖:
      getResourceAsStream 在类中 ClassLoader
    • getResources

      public Enumeration<URL> getResources(String name) throws IOException
      覆盖:
      getResources 在类中 ClassLoader
      抛出:
      IOException