Class FelixClassLoaderHandler
java.lang.Object
nonapi.io.github.classgraph.classloaderhandler.FelixClassLoaderHandler
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addBundle
(Object bundleWiring, ClassLoader classLoader, ClasspathOrder classpathOrderOut, Set<Object> bundles, ScanSpec scanSpec, LogNode log) Adds the bundle.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 File
getContentLocation
(Object content, ReflectionUtils reflectionUtils) Get the content location.
-
Constructor Details
-
FelixClassLoaderHandler
private FelixClassLoaderHandler()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
-
getContentLocation
Get the content location.- Parameters:
content
- the content object- Returns:
- the content location
-
addBundle
private static void addBundle(Object bundleWiring, ClassLoader classLoader, ClasspathOrder classpathOrderOut, Set<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(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.
-