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
ConstructorsModifierConstructorDescriptionprivate
Class cannot be constructed. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Check whether thisClassLoaderHandler
can handle a givenClassLoader
.static void
findClassLoaderOrder
(ClassLoader classLoader, ClassLoaderOrder classLoaderOrder, LogNode log) Find theClassLoader
delegation order for aClassLoader
.static void
findClasspathOrder
(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 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(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(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.
-