class PMMLLoaderService {

    public static List<KiePMMLModel> getKiePMMLModelsLoadedFromResource(final KnowledgeBuilderImpl kbuilderImpl,
                                                                        final Resource resource) {
        String[] classNamePackageName = getFactoryClassNamePackageName(resource);
        String factoryClassName = classNamePackageName[0];
        String packageName = classNamePackageName[1];
        String fullFactoryClassName = packageName + "." + factoryClassName;
        try {
            final KiePMMLModelFactory aClass = loadKiePMMLModelFactory(kbuilderImpl.getRootClassLoader(),
                                                                 fullFactoryClassName);
            final List<PMMLRuleMapper> pmmlRuleMappers = loadPMMLRuleMappers(kbuilderImpl.getRootClassLoader(), resource);
            return getKiePMMLModelsLoadedFromResource(kbuilderImpl, aClass, pmmlRuleMappers);
        } catch (ClassNotFoundException e) {
            logger.info(String.format("%s class not found in rootClassLoader, going to compile model",
                                      fullFactoryClassName));
        } catch (Exception e) {
            throw new KiePMMLException("Exception while instantiating " + fullFactoryClassName, e);
        }
        return Collections.emptyList();
    }

    private  PMMLLoaderService();

}