Class FelixClassLoaderHandler
- java.lang.Object
-
- nonapi.io.github.classgraph.classloaderhandler.FelixClassLoaderHandler
-
- All Implemented Interfaces:
ClassLoaderHandler
class FelixClassLoaderHandler extends java.lang.Object implements ClassLoaderHandler
Custom Class Loader Handler for OSGi Felix ClassLoader.The handler adds the bundle jar and all assocaited Bundle-Claspath jars into the classpath to be scanned.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
FelixClassLoaderHandler()
Class cannot be constructed.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
addBundle(java.lang.Object bundleWiring, java.lang.ClassLoader classLoader, ClasspathOrder classpathOrderOut, java.util.Set<java.lang.Object> bundles, ScanSpec scanSpec, LogNode log)
Adds the bundle.static boolean
canHandle(java.lang.Class<?> classLoaderClass, LogNode log)
Check whether thisClassLoaderHandler
can handle a givenClassLoader
.static void
findClassLoaderOrder(java.lang.ClassLoader classLoader, ClassLoaderOrder classLoaderOrder, LogNode log)
Find theClassLoader
delegation order for aClassLoader
.static void
findClasspathOrder(java.lang.ClassLoader classLoader, ClasspathOrder classpathOrder, ScanSpec scanSpec, LogNode log)
Find the classpath entries for the associatedClassLoader
.private static java.io.File
getContentLocation(java.lang.Object content, ReflectionUtils reflectionUtils)
Get the content location.
-
-
-
Method Detail
-
canHandle
public static boolean canHandle(java.lang.Class<?> classLoaderClass, LogNode log)
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(java.lang.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
-
getContentLocation
private static java.io.File getContentLocation(java.lang.Object content, ReflectionUtils reflectionUtils)
Get the content location.- Parameters:
content
- the content object- Returns:
- the content location
-
addBundle
private static void addBundle(java.lang.Object bundleWiring, java.lang.ClassLoader classLoader, ClasspathOrder classpathOrderOut, java.util.Set<java.lang.Object> bundles, ScanSpec scanSpec, LogNode log)
Adds the bundle.- Parameters:
bundleWiring
- the bundle wiringclassLoader
- the classloaderclasspathOrderOut
- the classpath order outbundles
- the bundlesscanSpec
- the scan speclog
- the log
-
findClasspathOrder
public static void findClasspathOrder(java.lang.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.
-
-