Class SpringBootRestartClassLoaderHandler
java.lang.Object
nonapi.io.github.classgraph.classloaderhandler.SpringBootRestartClassLoaderHandler
- All Implemented Interfaces:
ClassLoaderHandler
This handler uses
to support
the
invalid reference
nonapi.io.github.classgraph.classloaderhandler.ClassLoaderHandler.DelegationOrder#PARENT_LAST
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 Summary
ConstructorsModifierConstructorDescriptionprivateClass cannot be constructed. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck whether thisClassLoaderHandlercan handle a givenClassLoader.static voidfindClassLoaderOrder(ClassLoader classLoader, ClassLoaderOrder classLoaderOrder, LogNode log) Find theClassLoaderdelegation order for aClassLoader.static voidfindClasspathOrder(ClassLoader classLoader, ClasspathOrder classpathOrder, ScanSpec scanSpec, LogNode log) Find the classpath entries for the associatedClassLoader.
-
Constructor Details
-
SpringBootRestartClassLoaderHandler
private SpringBootRestartClassLoaderHandler()Class cannot be constructed.
-
-
Method Details
-
canHandle
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(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(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.
-