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 voidaddBundle(Object bundleWiring, ClassLoader classLoader, ClasspathOrder classpathOrderOut, Set<Object> bundles, ScanSpec scanSpec, LogNode log) Adds the bundle.static booleanCheck whether thisClassLoaderHandlercan handle a givenClassLoader.static voidfindClassLoaderOrder(ClassLoader classLoader, ClassLoaderOrder classLoaderOrder, LogNode log) Find theClassLoaderdelegation order for aClassLoader.static voidfindClasspathOrder(ClassLoader classLoader, ClasspathOrder classpathOrder, ScanSpec scanSpec, LogNode log) Find the classpath entries for the associatedClassLoader.private static FilegetContentLocation(Object content, ReflectionUtils reflectionUtils) Get the content location.
-
Constructor Details
-
FelixClassLoaderHandler
private FelixClassLoaderHandler()Class cannot be constructed.
-
-
Method Details
-
canHandle
Check whether thisClassLoaderHandlercan handle a givenClassLoader.- Parameters:
classLoaderClass- theClassLoaderclass or one of its superclasses.log- the log- Returns:
- true if this
ClassLoaderHandlercan handle theClassLoader.
-
findClassLoaderOrder
public static void findClassLoaderOrder(ClassLoader classLoader, ClassLoaderOrder classLoaderOrder, LogNode log) Find theClassLoaderdelegation order for aClassLoader.- Parameters:
classLoader- theClassLoaderto find the order for.classLoaderOrder- aClassLoaderOrderobject 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- theClassLoaderto find the classpath entries order for.classpathOrder- aClasspathOrderobject to update.scanSpec- theScanSpec.log- the log.
-