Class 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.
    • Constructor Detail

      • FelixClassLoaderHandler

        private FelixClassLoaderHandler()
        Class cannot be constructed.
    • Method Detail

      • canHandle

        public static boolean canHandle​(java.lang.Class<?> classLoaderClass,
                                        LogNode log)
        Check whether this ClassLoaderHandler can handle a given ClassLoader.
        Parameters:
        classLoaderClass - the ClassLoader class or one of its superclasses.
        log - the log
        Returns:
        true if this ClassLoaderHandler can handle the ClassLoader.
      • findClassLoaderOrder

        public static void findClassLoaderOrder​(java.lang.ClassLoader classLoader,
                                                ClassLoaderOrder classLoaderOrder,
                                                LogNode log)
        Find the ClassLoader delegation order for a ClassLoader.
        Parameters:
        classLoader - the ClassLoader to find the order for.
        classLoaderOrder - a ClassLoaderOrder 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 wiring
        classLoader - the classloader
        classpathOrderOut - the classpath order out
        bundles - the bundles
        scanSpec - the scan spec
        log - the log
      • findClasspathOrder

        public static void findClasspathOrder​(java.lang.ClassLoader classLoader,
                                              ClasspathOrder classpathOrder,
                                              ScanSpec scanSpec,
                                              LogNode log)
        Find the classpath entries for the associated ClassLoader.
        Parameters:
        classLoader - the ClassLoader to find the classpath entries order for.
        classpathOrder - a ClasspathOrder object to update.
        scanSpec - the ScanSpec.
        log - the log.