code: public static Class<?> loadClass(BundleContext context, String klassName) throws ClassNotFoundException {
          ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
          try {
              PackageAdmin padmin = (PackageAdmin) context.getService(sref);
              // extract package name
              String packageName = klassName.substring(0, klassName.lastIndexOf('.'));
              ExportedPackage pkg = padmin.getExportedPackage(packageName);
              if (pkg == null) {
                  try {
                      return context.getBundle().loadClass(klassName);
                  } catch (ClassNotFoundException e) {
                      throw new ClassNotFoundException("No package found with name " + packageName + " while trying to load the class "
                              + klassName + ".", e);
                  }
              }
              return pkg.getExportingBundle().loadClass(klassName);
          } finally {
              context.ungetService(sref);
          }
      }
docs: Load the Class of name <code>klassName</code>.
  TODO : handle class version
  
  @param context   The BundleContext
  @param klassName The Class name
  @return The Class of name <code>klassName</code>
  @throws ClassNotFoundException if we can't load the Class of name <code>klassName</code>