Class SpringBootRestartClassLoaderHandler

java.lang.Object
nonapi.io.github.classgraph.classloaderhandler.SpringBootRestartClassLoaderHandler
All Implemented Interfaces:
ClassLoaderHandler

class SpringBootRestartClassLoaderHandler extends Object implements ClassLoaderHandler
This handler uses
invalid reference
nonapi.io.github.classgraph.classloaderhandler.ClassLoaderHandler.DelegationOrder#PARENT_LAST
to support the RestartClassLoader of Spring Boot's devtools. RestartClassLoader provides parent last loading for specified URLs (those are all that are supposed to be changed during development). Therefor the handler for that class loader also has to delegate in PARENT_LAST order.
  • Constructor Details

    • SpringBootRestartClassLoaderHandler

      private SpringBootRestartClassLoaderHandler()
      Class cannot be constructed.
  • Method Details

    • canHandle

      public static boolean canHandle(Class<?> classLoaderClass, LogNode log)
      Check whether this ClassLoaderHandler can handle a given ClassLoader.
      Parameters:
      classLoaderClass - the ClassLoader class or one of its superclasses.
      log - the log
      Returns:
      true if this ClassLoaderHandler can handle the ClassLoader.
    • findClassLoaderOrder

      public static void findClassLoaderOrder(ClassLoader classLoader, ClassLoaderOrder classLoaderOrder, LogNode log)
      Find the ClassLoader delegation order for a ClassLoader.
      Parameters:
      classLoader - the ClassLoader to find the order for.
      classLoaderOrder - a ClassLoaderOrder object to update.
      log - the log
    • findClasspathOrder

      public static void findClasspathOrder(ClassLoader classLoader, ClasspathOrder classpathOrder, ScanSpec scanSpec, LogNode log)
      Find the classpath entries for the associated ClassLoader. Spring Boot's RestartClassLoader sits in front of the parent class loader and watches a given set of directories for changes. While those classes are reachable from the parent class loader directly, they should always be loaded through direct access from the RestartClassLoader until it's completely turned of by means of Spring Boot Developer tools. The RestartClassLoader shades only the project classes and additional directories that are configurable, so itself needs access to parent, but last. See: #267, #268
      Parameters:
      classLoader - the ClassLoader to find the classpath entries order for.
      classpathOrder - a ClasspathOrder object to update.
      scanSpec - the ScanSpec.
      log - the log.