All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.ebeaninternal.server.core.ClassPathScanners Maven / Gradle / Ivy

There is a newer version: 15.8.1
Show newest version
package io.ebeaninternal.server.core;

import io.avaje.classpath.scanner.ClassPathScanner;
import io.avaje.classpath.scanner.ClassPathScannerFactory;
import io.ebean.DatabaseBuilder;

import java.util.ArrayList;
import java.util.List;
import java.util.ServiceLoader;

/**
 * Utility to finds and return the list of ClassPathScanner services.
 */
public class ClassPathScanners {

  /**
   * Return the list of ClassPathScanner services using DatabaseConfig service loader.
   */
  public static List find(DatabaseBuilder.Settings config) {
    List scanners = new ArrayList<>();
    for (ClassPathScannerFactory factory : ServiceLoader.load(ClassPathScannerFactory.class)) {
      scanners.add(factory.createScanner(config.getClassLoadConfig().getClassLoader()));
    }
    return scanners;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy