Package io.quarkus.bootstrap.runner
Class RunnerClassLoader
java.lang.Object
java.lang.ClassLoader
io.quarkus.bootstrap.runner.RunnerClassLoader
Classloader used with the fast-jar package type.
This ClassLoader takes advantage of the fact that Quarkus knows the entire classpath when the application is built,
and thus can index the location of classes and resources (with the result being written during the build to a binary file and
read at application startup).
The advantage this has over the JDK's default System ClassLoader is that it knows which jars contain the requested
classes and resources and thus does not have to iterate over all the jars on the classpath
(which is slow and takes up heap space as the jars need to be kept open), but instead can go directly to the
jar(s) containing the requested class or resource.
The implementation also contains optimizations that allow the ClassLoader to keep a minimum number of jars open
while also preventing the lookup of the entire classpath for missing resources in known directories (like META-INF/services).
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
boolean
protected Class<?>
This method is needed to make packages work correctly on JDK9+, as it will be called to load the package-info class.protected URL
findResource
(String name) protected Enumeration<URL>
findResources
(String name) int
hashCode()
Class<?>
Class<?>
void
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Method Details
-
loadClass
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
loadClass
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
findResource
- Overrides:
findResource
in classClassLoader
-
findResources
- Overrides:
findResources
in classClassLoader
-
findClass
This method is needed to make packages work correctly on JDK9+, as it will be called to load the package-info class.- Overrides:
findClass
in classClassLoader
- Parameters:
moduleName
-name
-- Returns:
-
close
public void close() -
resetInternalCaches
public void resetInternalCaches() -
equals
-
hashCode
public int hashCode()
-