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_LASTto support theRestartClassLoaderof Spring Boot's devtools.RestartClassLoaderprovides 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_LASTorder.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateSpringBootRestartClassLoaderHandler()Class cannot be constructed.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancanHandle(java.lang.Class<?> classLoaderClass, LogNode log)Check whether thisClassLoaderHandlercan handle a givenClassLoader.static voidfindClassLoaderOrder(java.lang.ClassLoader classLoader, ClassLoaderOrder classLoaderOrder, LogNode log)Find theClassLoaderdelegation order for aClassLoader.static voidfindClasspathOrder(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 thisClassLoaderHandlercan handle a givenClassLoader.- Parameters:
classLoaderClass- theClassLoaderclass or one of its superclasses.log- the log- Returns:
- true if this
ClassLoaderHandlercan handle theClassLoader.
-
findClassLoaderOrder
public static void findClassLoaderOrder(java.lang.ClassLoader classLoader, ClassLoaderOrder classLoaderOrder, LogNode log)Find theClassLoaderdelegation order for aClassLoader.- Parameters:
classLoader- theClassLoaderto find the order for.classLoaderOrder- aClassLoaderOrderobject 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- theClassLoaderto find the classpath entries order for.classpathOrder- aClasspathOrderobject to update.scanSpec- theScanSpec.log- the log.
-
-