Class NamedClassLoader

  • Direct Known Subclasses:
    ConcurrentClassLoader

    public abstract class NamedClassLoader
    extends java.lang.ClassLoader
    A class loader that may be named. On Java 9 and later, the name will be propagated up to the JVM.
    Author:
    David M. Lloyd
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected NamedClassLoader​(java.lang.ClassLoader parent, java.lang.String name)
      Construct a new instance.
      protected NamedClassLoader​(java.lang.String name)
      Construct a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getName()
      Get the name of this class loader.
      • Methods inherited from class java.lang.ClassLoader

        clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NamedClassLoader

        protected NamedClassLoader​(java.lang.ClassLoader parent,
                                   java.lang.String name)
        Construct a new instance.
        Parameters:
        parent - the parent class loader (may be null to indicate that the platform class loader should be used)
        name - the name, or null if the class loader has no name
      • NamedClassLoader

        protected NamedClassLoader​(java.lang.String name)
        Construct a new instance.
        Parameters:
        name - the name, or null if the class loader has no name
    • Method Detail

      • getName

        public java.lang.String getName()
        Get the name of this class loader.
        Overrides:
        getName in class java.lang.ClassLoader
        Returns:
        the name of this class loader, or null if it is unnamed