Class WebsphereLibertyClassLoaderHandler
java.lang.Object
nonapi.io.github.classgraph.classloaderhandler.WebsphereLibertyClassLoaderHandler
- All Implemented Interfaces:
ClassLoaderHandler
WebsphereLibertyClassLoaderHandler.
Used to support WAS Liberty Profile classloading in io.github.classgraph
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Class cannot be constructed. -
Method Summary
Modifier and TypeMethodDescriptionprivate static Collection
<Object> callGetUrls
(Object container, String methodName, ReflectionUtils reflectionUtils) Utility to call a "getURLs" method, flattening "collections of collections" and ignoring "UnsupportedOperationException".static 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
.private static Collection
<Object> getPaths
(Object containerClassLoader, ReflectionUtils reflectionUtils) Get the paths from a containerClassLoader object.
-
Field Details
-
PKG_PREFIX
"com.ibm.ws.classloading.internal."
- See Also:
-
IBM_APP_CLASS_LOADER
"com.ibm.ws.classloading.internal.AppClassLoader"
- See Also:
-
IBM_THREAD_CONTEXT_CLASS_LOADER
"com.ibm.ws.classloading.internal.ThreadContextClassLoader"
- See Also:
-
-
Constructor Details
-
WebsphereLibertyClassLoaderHandler
private WebsphereLibertyClassLoaderHandler()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
-
getPaths
private static Collection<Object> getPaths(Object containerClassLoader, ReflectionUtils reflectionUtils) Get the paths from a containerClassLoader object.The passed in object should be an instance of "com.ibm.ws.classloading.internal.ContainerClassLoader".
Will attempt to use "getContainerURLs" methods to recap the classpath.
-
callGetUrls
private static Collection<Object> callGetUrls(Object container, String methodName, ReflectionUtils reflectionUtils) Utility to call a "getURLs" method, flattening "collections of collections" and ignoring "UnsupportedOperationException". All of the "getURLs" methods eventually call "com.ibm.wsspi.adaptable.module.Container#getURLs()". https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.javadoc.liberty.doc /com.ibm.websphere.appserver.spi.artifact_1.2-javadoc /com/ibm/wsspi/adaptable/module/Container.html?view=embed#getURLs() "A collection of URLs that represent all of the locations on disk that contribute to this container" -
findClasspathOrder
public static void findClasspathOrder(ClassLoader classLoader, ClasspathOrder classpathOrder, ScanSpec scanSpec, LogNode log) Find the classpath entries for the associatedClassLoader
.- Parameters:
classLoader
- theClassLoader
to find the classpath entries order for.classpathOrder
- aClasspathOrder
object to update.scanSpec
- theScanSpec
.log
- the log.
-