Class ClassLoaderOrder
java.lang.Object
nonapi.io.github.classgraph.classpath.ClassLoaderOrder
A class to find all unique classloaders.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set
<ClassLoader> The set of allClassLoader
instances that have been added to the order so far, so that classloaders don't get added twice.private final Set
<ClassLoader> The set of all parentClassLoader
instances that have been delegated to so far, to enableClassGraph.ignoreParentClassLoaders()
.private final List
<Map.Entry<ClassLoader, ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>> TheClassLoader
order.private final Set
<ClassLoader> The set of allClassLoader
instances that have been delegated to so far, to prevent an infinite loop in delegation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(ClassLoader classLoader, LogNode log) Add aClassLoader
to the ClassLoader order at the current position.void
delegateTo
(ClassLoader classLoader, boolean isParent, LogNode log) Recursively delegate to anotherClassLoader
.Get the all parent classloaders.Get theClassLoader
order.getRegistryEntry
(ClassLoader classLoader, LogNode log) Find theClassLoaderHandler
that can handle a givenClassLoader
instance.
-
Field Details
-
classLoaderOrder
private final List<Map.Entry<ClassLoader,ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>> classLoaderOrderTheClassLoader
order. -
reflectionUtils
-
added
The set of allClassLoader
instances that have been added to the order so far, so that classloaders don't get added twice. -
delegatedTo
The set of allClassLoader
instances that have been delegated to so far, to prevent an infinite loop in delegation. -
allParentClassLoaders
The set of all parentClassLoader
instances that have been delegated to so far, to enableClassGraph.ignoreParentClassLoaders()
. -
classLoaderToClassLoaderHandlerRegistryEntry
private final Map<ClassLoader,ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry> classLoaderToClassLoaderHandlerRegistryEntry
-
-
Constructor Details
-
ClassLoaderOrder
-
-
Method Details
-
getClassLoaderOrder
public List<Map.Entry<ClassLoader,ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry>> getClassLoaderOrder()Get theClassLoader
order.- Returns:
- the
ClassLoader
order, as a pair:ClassLoader
,ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry
.
-
getAllParentClassLoaders
Get the all parent classloaders.- Returns:
- all parent classloaders
-
getRegistryEntry
private ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry getRegistryEntry(ClassLoader classLoader, LogNode log) Find theClassLoaderHandler
that can handle a givenClassLoader
instance.- Parameters:
classLoader
- theClassLoader
.log
- the log- Returns:
- the
ClassLoaderHandlerRegistry.ClassLoaderHandlerRegistryEntry
for theClassLoader
.
-
add
Add aClassLoader
to the ClassLoader order at the current position.- Parameters:
classLoader
- the class loaderlog
- the log
-
delegateTo
Recursively delegate to anotherClassLoader
.- Parameters:
classLoader
- the class loaderisParent
- true if this is a parent of another classloaderlog
- the log
-