Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add diagram of Quarkus ClassLoader hierarchy #34818

Merged
merged 2 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions docs/src/main/asciidoc/class-loading-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,18 @@ prevent the transformation, as the loaded class is not used at runtime.

== ClassLoader Implementations

Quarkus has the following ClassLoaders:
Quarkus has a number of ClassLoaders. This shows the relationship between them :

image::classloader-hierarchy.png[alt=Quarkus ClassLoader hierarchy,role="center"]

Here are the roles of each ClassLoader:

Base ClassLoader::

This is usually the normal JVM System ClassLoader. In some environments such as Maven it may be different. This ClassLoader
is used to load the bootstrap classes, and other ClassLoader instances will delegate the loading of JDK classes to it.

Augment ClassLoader::
Augmentation ClassLoader::

This loads all the `-deployment` artifacts and their dependencies, as well as other user dependencies. It does not load the
application root or any hot deployed code. This ClassLoader is persistent, even if the application restarts it will remain
Expand All @@ -84,15 +88,15 @@ the builder classes are isolated, which means that use cases that want to custom

Deployment ClassLoader::

This can load all application classes. Its parent is the Augment ClassLoader, so it can also load all deployment classes.
This can load all application classes. Its parent is the Augmentation ClassLoader, so it can also load all deployment classes.

This ClassLoader is non-persistent, it will be re-created when the application is started, and is isolated. This ClassLoader
is the context ClassLoader that is used when running the build steps. It is also transformer safe.

Base Runtime ClassLoader::

This loads all the runtime extension dependencies, as well as other user dependencies (note that this may include duplicate
copies of classes also loaded by the Augment ClassLoader). It does not load the application root or any hot deployed
copies of classes also loaded by the Augmentation ClassLoader). It does not load the application root or any hot deployed
code. This ClassLoader is persistent, even if the application restarts it will remain (which is why it cannot load
application classes that may be hot deployed). Its parent is the base ClassLoader.

Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.