private static void registerServiceIfNotPresentByName()

in core/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java [158:168]


    private static void registerServiceIfNotPresentByName(@NotNull BundleContext bundleContext,
            @NotNull String interfaceClassName, @NotNull String implClassName) {
        try {
            Class<?> interfaceClass = Class.forName(interfaceClassName);
            Class<?> implClass = Class.forName(implClassName);
            registerServiceIfNotPresent(bundleContext, (Class)interfaceClass, implClass.newInstance());
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
            // ignore - probably not the latest sling models impl version
            log.debug("registerServiceIfNotPresentByName: Skip registering {} ({}), bundleContext={}", implClassName, interfaceClassName, bundleContext);
        }
    }