Class SpringBootRestartClassLoaderHandler
- java.lang.Object
-
- nonapi.io.github.classgraph.classloaderhandler.SpringBootRestartClassLoaderHandler
-
- All Implemented Interfaces:
ClassLoaderHandler
class SpringBootRestartClassLoaderHandler extends java.lang.Object implements ClassLoaderHandler
This handler usesnonapi.io.github.classgraph.classloaderhandler.ClassLoaderHandler.DelegationOrder#PARENT_LAST
to support theRestartClassLoader
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 inPARENT_LAST
order.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
SpringBootRestartClassLoaderHandler()
Class cannot be constructed.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
canHandle(java.lang.Class<?> classLoaderClass, LogNode log)
Check whether thisClassLoaderHandler
can handle a givenClassLoader
.static void
findClassLoaderOrder(java.lang.ClassLoader classLoader, ClassLoaderOrder classLoaderOrder, LogNode log)
Find theClassLoader
delegation order for aClassLoader
.static void
findClasspathOrder(java.lang.ClassLoader classLoader, ClasspathOrder classpathOrder, ScanSpec scanSpec, LogNode log)
Find the classpath entries for the associatedClassLoader
.
-
-
-
Method Detail
-
canHandle
public static boolean canHandle(java.lang.Class<?> classLoaderClass, LogNode log)
Check whether thisClassLoaderHandler
can handle a givenClassLoader
.- Parameters:
classLoaderClass
- theClassLoader
class or one of its superclasses.log
- the log- Returns:
- true if this
ClassLoaderHandler
can handle theClassLoader
.
-
findClassLoaderOrder
public static void findClassLoaderOrder(java.lang.ClassLoader classLoader, ClassLoaderOrder classLoaderOrder, LogNode log)
Find theClassLoader
delegation order for aClassLoader
.- Parameters:
classLoader
- theClassLoader
to find the order for.classLoaderOrder
- aClassLoaderOrder
object to update.log
- the log
-
findClasspathOrder
public static void findClasspathOrder(java.lang.ClassLoader classLoader, ClasspathOrder classpathOrder, ScanSpec scanSpec, LogNode log)
Find the classpath entries for the associatedClassLoader
. 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
- theClassLoader
to find the classpath entries order for.classpathOrder
- aClasspathOrder
object to update.scanSpec
- theScanSpec
.log
- the log.
-
-